Immigration Minister Peter Dutton says about 900 men being held at the Manus Island detention centre will not be brought to Australia after Papua New Guinea's Supreme Court ruled their detention was illegal.
The decision strikes one of the central pillars of the Turnbull government's border protection regime, just weeks out from an election campaign in which the government is expected to heavily spruik its asylum seeker record.
In a statement on Tuesday afternoon, Mr Dutton said the legal proceedings did not alter Australia's border protection policies, which "remain unchanged". 
The court ruled the detention breached the constitutional right of asylum seekers to personal liberty. It ordered the Australian and PNG governments to immediately cease the "unconstitutional and illegal detention of asylum seekers" at Manus Island, and stop the breach of their human rights.
But the scale of this task is reflected in the fact that only eight of more than 1000 asylum seekers who were held in the centre have moved into the PNG community.
Three of these refugees returned to Manus Island and attempted to re-enter the island's transit centre and two were arrested, as reported exclusively by Fairfax Media.
The vast majority of men in the detention centre have been found to be refugees. The court ruling said they were seeking asylum in Australia but were "forcefully brought into PNG" and locked in an Australian-funded centre "enclosed with razor wire".
Mr Dutton said on Tuesday that no one who attempts to travel to Australia "illegally" by boat will settle in Australia.
"The government will not allow a return to the chaos of the years of the Rudd-Gillard Labor governments when regional processing was initiated to deal with the overwhelming illegal arrivals of more than 50,000 people," he said, adding the agreement with PNG to establish the detention centre was negotiated by Labor. He said refugees at Manus Island could resettle in PNG and those whose claims were rejected should return to their country of origin.
PNG's immigration minister, Rimbink Pato, told Fairfax Media he would issue a statement on the ruling after it was "considered properly" and legal advice was obtained.
Labor's immigration spokesman Richard Marles said the ruling was "of significant concern" and said Mr Dutton should be dispatched to Port Moresby to hold urgent talks with the PNG government.
"Labor is seeking an assurance from the government that it has a contingency plan to deal with today's ruling. This decision, and our government's response, will be monitored by people-smuggling networks," Mr Marles said.
He said the original agreement Labor struck did not intend for Manus Island to be "a punitive place of indefinite detention" and claimed the government had failed to properly manage its offshore processing network after three years in office.
"Mr Dutton and his predecessor, Scott Morrison failed to properly engage with the government of PNG to ensure processing was occurring in a timely manner," he said. "In doing so, this government has breached its duty of care to each one of those men, women and children."
PNG immigration authorities attempted to prepare for an adverse decision by signalling their intention to move refugees out of detention and into the transit centre in Lorengau. But the preparations have been resisted by asylum seekers.
This week the PNG immigration department asserted 542 refugees had been offered resettlement in PNG, including just 74 who had moved from the detention centre to the transit centre.
Australian Human Rights Commission president Gillian Triggs said the unanimous ruling by five judges was "further confirmation that Australia's detention policies are increasingly out of step with international norms".
Greens immigration spokeswoman Sarah Hanson-Young said the court ruling showed Australia "has been illegally detaining refugees on Manus Island for years".
"The [Turnbull] government has got to shut the Manus Island detention camp and bring these people here," she said.
Australian Lawyers Alliance spokesman Greg Barns said the decision was consistent with international law which stated that indefinite detention was unlawful.