An exterior view of the government offices of the small island nation of Nauru is pictured, February 10, 2012. Australia has flooded Nauru with money since 2012, when the island became a key plank in its controversial policy of dealing with asylum seekers. Photo: AUSTRALIA-NAURU/ REUTERS/Rod Henshaw

A pregnant woman who says she was raped at an Australia detention center for asylum seekers on the tiny South Pacific island of Nauru cannot be forced to have an abortion in Papua New Guinea because it is unsafe and illegal, a court has ruled.

Under Australia's hardline immigration policy, asylum seekers intercepted at sea trying to reach Australia are sent for processing to camps on Nauru and on Manus Island in Papua New Guinea and are told they will never be settled in Australia.

The harsh conditions and reports of systemic child abuse at the camps, which house asylum seekers fleeing violence in Syria, Iraq, South Asia and Africa as well as those deemed economic migrants, have drawn wide criticism from the United Nations and human rights groups.

The African woman, identified in court documents only as S99, has claimed she was raped while she was in Nauru and has sought an abortion in Australia.

Australian Immigration Minister Peter Dutton however ordered that she should be sent to Papua New Guinea for the procedure, Australia's Federal Court heard.

Justice Mordecai Bromberg ruled late on Friday that the procedure was illegal in Papua New Guinea and that PNG lacked the medical expertise and facilities to treat several other undisclosed physiological and psychological conditions.

"The abortion in Papua New Guinea made available to the applicant is attended by safety and lawfulness risks that a reasonable person in the minister's position would have avoided," Bromberg said in his 150-page judgment, a heavily redacted copy which has yet to be published.

Bromberg also ruled that the woman should remain in PNG until at least May 15.

A spokesman for Dutton said the court's decision was "under consideration" and foreshadowed an appeal.

The woman's lawyer, George Newhouse, said PNG law prohibits abortion, although there are exemptions for when the procedure is needed to save a mother's life.

Australia has been at loggerheads with PNG since the government ordered the Manus Island camp closed late last month. The camp, which holds about 850 people, had been ruled illegal by the PNG Supreme Court.

The number of people trying to reach Australia is small compared with Europe but immigration has long been a hot political issue and has flared again during campaigning for likely July elections.

Two people have set themselves alight this month in protest at their treatment in the Nauru camp. A 23-year-old Iranian man died and a young Somali woman is in critical condition in an Australian hospital.