Following Papua New Guinea's Supreme Court ruling Tuesday, Prime Minister Peter O'Neill announced that he will ask Australia to seek other options for detainees at the Manus regional processing center in the Pacific island nation.
"We did not anticipate the asylum seekers to be kept as long as they have at the Manus center," O'Neill said.
Around 900 men are in the detention center on the Papua New Guinea island, according to Australian immigration authorities.
O'Neill said Papua New Guinea would welcome "legitimate" refugees who want to settle in his country.
While acknowledging the economy would suffer as a result of the closure, he pledged to work with Australia to ensure business owners would be taken care of. Negotiations with Australia will determine the time frame of the closure.
He also said he was proud of the part Papua New Guinea played in stopping deaths caused by the people-smuggling trade.
Iranian detainee sets himself on fire
Meanwhile, an 23-year-old Iranian asylum seeker housed in another Australian offshore detention camp on the island nation of Nauru, several hundred miles from Papua New Guinea, is in critical condition after setting himself on fire in front of representatives from the United Nations High Commissioner for Refugees (UNHCR).
"But he's in a very, very serious condition and his outlook is not good at all."
A witness who was in the room when the incident occurred told CNN the man had become "very angry and everything happened (so) fast."
"He was burning. He was in a lot of pain running around (so) bad," said the witness. "All his body got burned unfortunately."
"The last words that come out of his mouth was that I'm just sick of here and you still think we are (OK)."
Nauru's government said the detainee was protesting conditions on the island and timed his act to coincide with the UNHCR visit.
"Unfortunately we have seen protests like this during high-profile visits, as some from within the refugee community try and influence the Australian government's offshore processing policies," the government statement read.
It said that it "continues to urge our refugee community to refrain from such protests for the protection of themselves and others."
Catherine Stubberfield, spokeswoman for UNHCR in Australia's capital, said that UNHCR staff and doctors accompanying the mission tried to help the man with blankets and water and remained on site until he was taken by car to a hospital.
"UNHCR remains seriously concerned about the grave mental health status of large numbers of asylum seekers and refugees," said Stubberfield, adding that UNHCR staff at the site had not spoken to the man prior to the accident.
'Treated as prisoners'
Some 1,200 people are currently detained in offshore "regional processing centers" on Manus and Nauru, thousands of miles from Australia, according to immigration authorities.
Some detainees have been in the camps for more than three years. Government figures show the average length of detention as 454 days, as of the end of March.
"It's not a crime to want to have a better life and future," said one 18-year-old girl who asked CNN not to reveal her name because she fears for her safety. "We are treated as prisoners."
'No change' in Australian policy
The Papua New Guinea court's decision "does not alter Australia's border protection policies," Dutton said.
"No one who attempts to travel to Australia illegally by boat will settle in Australia," he said in a statement.
"Those in the Manus Island Regional Processing Center found to be refugees are able to resettle in Papua New Guinea," he added. "Those found not to be refugees should return to their country of origin. People who have attempted to come illegally by boat and are now in the Manus facility will not be settled in Australia."
'Treat people like human beings'
Campaigners against the detention centers welcomed the court's decision.
"It is well time to close these awful detention camps on Manus (and) Nauru and start treating people like human beings. Anything less is senseless," Greens Sen. Sarah Hanson-Young tweeted.
Daniel Webb, director of legal advocacy at the Human Rights Law Center, said the conditions on Manus were "incredibly harmful."
"We've known it's cruel, we've known it's inhumane, today's judgment confirms it's illegal."
He added that Tuesday's ruling should be a "wake-up call" to the Australian government.
"Legally, there may be a few ways to respond," said Aurora Adams, a human rights campaigner at Get Up.
"Morally there is only one option, the camps must be closed."
She described Dutton's statement as "highly disappointing," adding that there was a clear popular mandate within Australia for the government to change its policy.
CNN's Zahra Ullah and Tim Hume contributed to this report.