This, barrister Ron Merkel told the Federal Court, was tantamount to Australia "procuring illegal conduct" in PNG. The practice is part of the Australian government's determination that people who arrived by boat in Australia, and were instead sent to Manus Island or Nauru, do not set foot on Australian soil, a senior bureaucrat told the court. The Federal Court in Melbourne is considering the case of a young African woman, known only as S99, who was in the midst of a violent epilepsy seizure and barely conscious when she was raped on Nauru. Abortion is illegal in the tiny island nation. The young woman, who was married at 16 to an abusive husband who later tracked her down and denounced her to the murderous al-Shabaab group, was granted refugee status by Nauru. She is now more than 12 weeks pregnant, and suffers from severe mental illness, her legal team says. She can no longer have a medical termination and must instead undergo a surgical procedure, but she requires specialist care for regular and violent seizures.

As Fairfax Media revealed a fortnight ago, the woman's legal battles began when she begged Australian officials on Nauru to let her come here to terminate the pregnancy she does not want. Instead, Australia sent her to Port Moresby for an abortion, where she remains in limbo after an emergency court order was imposed preventing an abortion being carried out until the current case is resolved. Abortion is also illegal in Papua New Guinea, according to its criminal code, which states a woman who attempts to "procure her own miscarriage" faces a maximum seven years' imprisonment. Last year a PNG couple were jailed for five years for causing the death of their unborn child. But the federal government says the risk of her being prosecuted for having an abortion is negligible, and says - despite flying her to PNG, paying for her accommodation and arranging her visa to PNG - it does not bear responsibility for the woman's care. IHMS officials have repeatedly raised serious concerns about the woman's care. In a letter to the department, IHMS warned that the woman faced long-term health and psychological consequences if she was forced to endure a pregnancy she did not want. "The mental health risks are greater the longer the pregnancy progresses against her will," the report said.

David Nockels, assistant secretary of Australian Border Force's detention services division, told the court he did not seek any independent legal advice about sending the woman to PNG. Instead, he sought the advice of Mathias Sapuri, a senior consultant, obstetrician and gynaecologist at PIH hospital, who is also a shareholder of the hospital. "I would assume he would have an appreciation of that [legal situation]," Mr Nockels said. Mr Nockels sent the woman to PNG against the "urgent" medical advice of senior health officials on Nauru, who recommended the woman come to Australia, the court was told. He said sending the woman to Australia would have breached immigration policy. "From a policy perspective in terms of bringing people back to Australia if there are other alternatives ... we would pursue that," he said.

"That's why we have Nauru and Manus ... that's the policy perspective." Justice Mordecai Bromberg will deliver his ruling at a later date.