SYDNEY — All of Australia's Aborigines, regardless of birthplace or nationality, are automatically Australian citizens, the nation's highest court ruled Tuesday in a decision that undercut an anti-crime campaign by the populist government of Prime Minister Scott Morrison that has drawn criticism from human rights advocates.

In a 4-to-3 decision, the High Court accepted that Aborigines have a unique connection with their traditional lands and therefore can never be regarded as foreigners, even if they have not held Australian citizenship.

The case was triggered by a decision by Morrison’s government to deport two Aboriginal men who had been convicted of separate assaults after spending almost their whole lives in Australia.

Lawyers for Daniel Love, who was born in Papua New Guinea, and Brendan Thoms, who was born in New Zealand, argued successfully that an indigenous person can never be classified as an “alien.”

The case, which was essentially a clash between Australia’s recognition of historical wrongs against its original inhabitants and its growing modern hostility toward outsiders perceived to be a threat to society, marks the first time the courts have curtailed an increasingly active policy of expelling lifelong residents who have been sentenced to prison terms as short as one year.

Thoms cannot be deported, the court said. But it said that Love, who says he is a member of the Kamilaroi tribe from central-eastern Australia, will need to take the extra step of proving his indigenous heritage.

“Throughout history, the lives of dispossessed and exiled persons and their descendants have been sustained, and their identities shaped, by the hope of returning to their places of belonging,” the court’s newest and youngest judge, James Edelman, said in his judgment.

“The identity of Aboriginal people, whether citizens or non-citizens, is shaped by a fundamental spiritual and cultural sense of belonging to Australia. It is that identity which constitutes them as members of the Australian political community.”

Some lawyers say the decision could trigger challenges to other aspects of government immigration policy, including stripping citizenship from people who have fought for foreign terrorist groups, and deporting permanent residents convicted of criminal offenses who have spent their whole lives in Australia and have spouses and children.

“It has broken through the barrier,” said Michelle Foster, director of the Peter McMullin Center on Statelessness at the University of Melbourne Law School.

“When this debate started, back in the 1980s, there was a limit of 10 years living in Australia on deportations. There was a view that once they had been here 10 years, they became our problem. Now, they can be deported if they have been here since they were 2 weeks old,” she said.

Under Morrison’s conservative coalition government, Australia’s approach to foreign nationals convicted of crimes has been similar in some ways to that of the Trump administration, matching its tough position on asylum seekers.

The United Nations Human Rights Committee has found Australia in breach of the International Covenant on Civil and Political Rights for holding asylum seekers in long-term detention.

More than 4,700 foreign criminals have been deported from Australia over the past six years, according to government officials.

The response from the government to Tuesday’s court decision was muted. Acting immigration minister Alan Tudge said the ruling appeared to create a new category of person who was “neither an Australian citizen under the Australian Citizenship Act nor a noncitizen.”

“The Department of Home Affairs will consider the best methods to review other cases which may be impacted,” he said.