The ruling, which gives Aboriginal people special status under the law, is seen as a landmark moment for the country’s first inhabitants.

The judges narrowly voted in favour of the decision by four to three.

The case related to two men, Brendan Thoms and Daniel Love, who have Aboriginal heritage but were born abroad. They both moved to Australia as young children.

Thoms and Love faced deportation after serving prison sentences for violent crimes.

Lawyer Claire Gibbs speaks to reporters outside the High Court in Canberra (AP)

Acting Immigration Minister Alan Tudge said the judgement was “significant,” adding that the court had “created a new category of persons” – neither citizen nor non-citizen.

Claire Gibbs, the lawyer acting for Thoms, celebrated the ruling, saying: “This case isn’t about citizenship. It’s about who belongs here, who’s an Australian national and who’s a part of the Australian community.”

Gibbs said that Thoms, who had spent “500 sleepless nights” worrying about deportation, was very happy to be reunited with his family after his release from detention in Brisbane.

Thoms is part of the Gunggari tribe and has legal rights to traditional land.

However, judges could not decide whether the same special status applies to Love, who is from the Kamilaroi tribe. They considered it unclear whether he is a recognized member of the tribe.

Mary Crock, professor of public law at Sydney University, said the ruling was “radical” and a “very positive development.”

“The case only went to the High Court because Australia uniquely has been trying so hard to deport so many different people. I can’t think of another country that has gone as far as we have towards locking up and then trying to deport people who literally have no other country that they deeply belong to,” Crock added.