A refugee has set herself on fire at an Australian-run detention centre on the Pacific island of Nauru, just days after an Iranian man died in a similar act in protest against his treatment.

Australian officials said a Somali woman was in a critical condition after she set herself alight on Monday.

The incident sparked debate on social media with the hashtag #Only19, the purported age of the Somali woman, trending in Australia, with users uploading and tweeting photos of when they were 19.

Peter Dutton, immigration minister, acknowledged there had been a rise in cases of self-harm in the camps and accused refugee advocates of giving the asylum seekers false hope that they would one day be settled in Australia.

Some advocates were "encouraging some of these people to behave in a certain way", he said on Tuesday.

However, the top UN body for refugees said such incidents in the camps, which hold asylum seekers fleeing violence and hardship in the Middle East, Afghanistan and South Asia, were a result of Australia's tough offshore detention polices.

"These people have already been through a great deal. Many have fled war and persecution, some have already suffered trauma," the office of the United Nations High Commissioner for Refugees in Australia said in a statement.

"The consensus among medical experts is that conditions of detention and offshore processing do immense damage to physical and mental health," it said.

'Political protest'

Last week, a 23-year-old Iranian man known as Omid set fire to himself on Nauru during a visit by UN representatives, an act the Nauru government said was a "political protest".

Under Australia's immigration policy, asylum seekers attempting to reach the country by boat are intercepted and sent to camps on the Nauru, about 3,000km northeast of Australia, or on Manus island in Papua New Guinea.

READ MORE: A glimpse of Australia's Manus Island refugee prison

The harsh conditions and reports of systemic child abuse at the camps have drawn wide criticism inside and outside Australia and have become a major headache for Malcolm Turnbull, Australia's prime minister, during campaigning for July national elections.

The government argues that the approach, which also includes turning back boats, has prevented drownings by stopping people from making the dangerous journey, often from Indonesia.

Papua New Guinea's Supreme Court last week found its centre on Manus Island, which has some 850 detainees, to be unconstitutional, prompting the government in Port Moresby to order it closed.