Papua New Guinea's Supreme Court on Tuesday ruled that Australia's practice of detaining asylum seekers on PNG's northern Manus Island was illegal and must stop.
Papua New Guinea's highest court said the detentions 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 800 people are detained on Manus Island on behalf of Australia. The detention center on Nauru houses about 500 people and has been widely criticized by the United Nations and human rights agencies for harsh conditions and reports of systemic child abuse.
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 Centre 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."
Australia's asylum seeker policy has attracted international criticism from human rights groups.
"People have been detained for over three years in contravention of the laws of Papua New Guinea in abusive conditions," said Elaine Pearson, Australia Director at Human Rights Watch.
"It is time to stop the abuse of vulnerable people who only ask for safety and the opportunity to rebuild their lives."