The fate of hundreds of asylum seekers being held in a detention center in Papua New Guinea is in limbo as Australian government officials scramble to respond to a court ruling that Australia's detention of the men on the island nation is illegal.

The fallout from Papua New Guinea's Supreme Court decision came as an Iranian refugee at Australia's other offshore detention center on Nauru set himself on fire in an apparent protest over Australia's strict asylum seeker policies.

Australian Immigration Minister Peter Dutton said the man would be airlifted off the Pacific island nation for medical treatment on Wednesday night.

The court ruling and incident on Nauru prompted fresh questions about Australia's divisive policy of refusing to accept asylum seekers who try to reach its shores by boat.