The ruling is being seen as a historic moment for the recognition of Australia's first inhabitants.
The case relates to an appeal by two men who have Aboriginal heritage but foreign citizenship, and were to be deported over their criminal record.
The government said the ruling created "a new category of persons" under law.
Brendan Thoms and Daniel Love - who had no prior connection - were born in New Zealand and Papua New Guinea respectively but moved to Australia as children.
Each man has Aboriginal heritage and one Australian parent. Both have children who are Australian citizens and were themselves permanent residents.
The two men both had criminal records and had both served jail sentences for violent assault.
Under controversial Australian laws, foreigners - or aliens - must lose their right to live and work in the country if they are sentenced to a year or more in prison.
Both men had their visas cancelled in 2018, but appealed against the order.
What did the court rule?
The High Court had been asked to rule for the first time on whether, as indigenous people, Love and Thoms could really be considered "aliens" under the constitution.
The men's lawyers argued that the men could not be considered alien because of their deep ancestral roots to Australia.
The judges ruled four to three that Aboriginal Australians were "not within the reach" of the constitutional references to foreign citizens.
"Aboriginal Australians have a special cultural, historical and spiritual connection with the territory of Australia, which is central to their traditional laws and customs and which is recognised by the common law," said the ruling.
The existence of that connection, they said, meant Aboriginal Australians could not be classed as "alien" under the law.
Acting Immigration Minister Alan Tudge said the ruling "created a new category of persons; neither an Australian citizen under the Australian Citizenship Act, nor a non-citizen".
The government was still considering the implications, he said, and would "consider the best methods to review other cases which may be impacted".