A brain-dead pregnant woman was taken off life support Friday after a court ruled that her 18-week-old fetus was doomed to die — a case that exposed fear and confusion among doctors over how to apply Ireland's strict ban on abortion in an age of medical innovation.

The three-judge Dublin High Court said that all artificial support for the woman should end more than three weeks after she was declared clinically dead. Her relatives gathered at a hospital in the Irish Midlands to bid farewell to the unidentified woman, who was in her late 20s and had two young children.

In their 29-page ruling, the judges accepted testimony from seven doctors who said the fetus couldn't survive for the extra two months of development needed to be delivered safely. The doctors detailed how the woman's body was becoming a lethal environment rife with infections, fungal growths, fever and high blood pressure.

The nation's Supreme Court was put on standby for an appeal, given the constitutional questions at stake. But lawyers representing the rights of the woman and of the fetus said they accepted the ruling from the country's second-highest court.

Ireland has the strictest abortion ban in Europe, a reflection of the country's heavily Roman Catholic population. But Dublin's archbishop had suggested before the decision came down that he would have no objection to removing life support.

Lack of explicit laws

The woman suffered irreversible brain death on Dec. 3, four days after sustaining a severe head injury in a fall. She had already been hospitalized after doctors found a cyst in her brain.

Doctors refused family pleas to turn off a half-dozen machines that regulated oxygen, blood flow, nutrition and waste collection, citing fears they could be sued for negligence or even face murder charges if they cut life-sustaining support for the fetus.

One doctor testified that he and two colleagues couldn't agree on how Ireland's constitutional ban on abortion should be applied, given the lack of explicit laws or guidelines for such cases.

Other doctors described the woman as a corpse unrecognizable from the photo by her bedside. Another noted that the body was being pumped with drugs never authorized for use on a pregnant woman and described what they were doing as experimental and, if it persisted, grotesque.

The judges said the fetus faced "a 'perfect storm' from which it has no realistic prospect of emerging alive. It has nothing but distress and death in prospect."

The woman's life support, they said, was "being maintained at hugely destructive cost to both her remains and to the feelings and sensitivities of her family and loved ones."

'A woman isn't simply an incubator'

The court said it was wrong to continue to deprive the woman "of dignity in death and subject her father, her partner and her young children to unimaginable distress in a futile exercise which commenced only because of fears held by treating medical specialists of potential legal consequences."

The Catholic Church questioned why secular authorities had not established clear guidelines for cases where a woman dies and doctors determine that the fetus can't survive on its own.

"There is no obligation to use extraordinary means to maintain a life. That applies both to the woman and to the child," said Dublin Archbishop Diarmuid Martin, who spoke before Friday's ruling and declined to comment on the specific case.

"A woman isn't simply an incubator. The relation between a woman and a child is a relationship, and it is very clear that one has to examine at what stage is this fetus, what are the possibilities," he said.

The judges did leave open the possibility that future cases might be handled differently if the fetus was significantly closer to delivery age, even if its deteriorating environment meant a higher risk of abnormalities.

They said Ireland's ban on abortion commits authorities to defend equally the right to life of the mother and unborn child. Because the mother is already dead in such cases, the judges found, the rights of the living fetus "must prevail over the feelings of grief and respect for a mother who is no longer living."

Irish women seek procedures abroad

Health Minister Leo Varadkar, who favours creating more medical exceptions to Ireland's blanket ban on abortion, said the government would study the ruling.

Ireland's main anti-abortion group, the Pro Life Campaign, said requiring such cases to go to court "is a sign of a healthy democracy" and demonstrated that Ireland treats matters of life and death seriously.

Irish doctors have appealed for decades for clearer guidelines on when they may terminate a pregnancy. Irish law permits this only when deemed necessary to save the woman's life. Parliament passed the law last year after a 31-year-old woman, suffering a protracted miscarriage, was refused an abortion and died of blood poisoning.

An estimated 4,000 Irishwomen travel each year for abortions in neighbouring England, where the practice was legalized in 1967.