Australia's detention of asylum seekers in Papua New Guinea (PNG) is illegal and must stop, ruled PNG's Supreme Court on Tuesday.
In a decision hailed as a momentous victory by human right advocates and activists, the court said the detentions on PNG's northern Manus Island breached the country's constitution.
Under Australia's controversial immigration laws, anyone intercepted while trying to reach the country by boat is sent for processing to camps in Nauru and Manus Island. They are never eligible to be resettled in Australia.
More than 900 people are detained on Manus Island on Australia's behalf, while the detention center on Nauru holds about 500 people, including 70 children.
Both have been widely criticized by the United Nations and human rights agencies for harsh conditions and reports of widespread assault, sexual violence, and systemic child abuse. They are off-limits to journalists.
Australia's wider asylum seeker policy has also attracted international criticism from human rights groups.
Australian Minister for Immigration Peter Dutton said the ruling would not change its policy of offshore detention. "It does not alter Australia's border protection policies — they remain unchanged," said Dutton.
"Those in the Manus Island Regional Processing Center found to be refugees are able to resettle in Papua New Guinea. Those found not to be refugees should return to their country of origin."
The PNG government has said it plans to close down the Manus center, but has provided no timetable.
In Tuesday's ruling the majority judgment found that, "the undisputed facts clearly reveal that the asylum seekers had no intention of entering and remaining in PNG. Their destination was and continues to be Australia. They did not enter PNG and do not remain in PNG on their own accord."
The vast majority of people held in the Manus detention center have been found to be refugees, reported the Sydney Morning Herald, but only eight of more than 1,000 asylum seekers who have been held there have moved into the PNG community.
Two refugees have resettled in Cambodia under a $55 million deal signed between Australia and its Asian neighbor in 2015. Australia spent about $1.1 billion Australian dollars between 2014 and 2015 on the two PNG centers.
Human rights activist group GetUP welcomed Tuesday's court ruling. "We need to bring these people here," spokeswoman Aurora Adams said in a statement reported by 9News.
"It is time to stop the abuse of vulnerable people who only ask for safety and the opportunity to rebuild their lives. The moral case is clear, there is no justification for locking people in offshore prison camps indefinitely."
Follow VICE News on Twitter: @vicenews