The life-support machine of a pregnant, brain-dead woman will be switched off, a judge in a Dublin High Court has ruled.
In a landmark ruling, the judge said keeping the young mother alive would deprive her of dignity in death.
The family of the woman, who is 18 weeks pregnant, had appealed for her life-support machine to be turned off after she was declared brain dead on 3 December.
Doctors had initially refused to support the decision, as they were unsure of the legal status of the unborn child under the constitution in the Republic of Ireland. They feared they might face prosecution under Ireland's strict abortion laws, which give the 18-week-old foetus the same constitutional rights as the mother, because there was still a foetal heart beat.
Lawyers representing the unborn child had told the court that it must be satisfied that there was no real possibility of the foetus surviving, before allowing the machine to be turned off.
The court had heard that the chances of her unborn child being born alive were small.
Lawyers for the Health Service Executive (HSE), the body which runs all public health services in the Republic of Ireland, had argued that it would be lawful to withdraw life-support in this case.
The panel of judges said it was in the best interest of the unborn child to authorise the withdrawal of life support in what was a "tragic and unfortunate case".
Describing it as a case of "great public importance" the presiding Judge Nicholas Kearns said that to "maintain and continue" the present support would "deprive her of dignity in death".
In a 29-page written judgement, Justice Kearns said: "The court is satisfied, in the circumstances of this case, that in the best interest of the unborn child, it should authorise at the discretion of the medical team the withdrawal of ongoing somatic support being provided in this tragic and unfortunate case. It will accordingly make a declaration and order to that effect."
The panel said: "It would 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."
Irish Health Minister Leo Varadkar said he would be carefully examining the ruling.
"I wish to convey my heartfelt sympathies to the family and partner of the woman at the centre of this case at this most difficult time - particularly given the season," he said.
"This case and the judgement will need to be carefully examined before I can make any further comment on it. In the meantime, I would ask that the privacy of this family is respected, at this so difficult and challenging time."
The 26-year-old mother of two was pronounced clinically dead after suffering a trauma injury last month when she fell over in a hospital bathroom. She was originally admitted for nausea and headaches.
A build-up of fluid in her brain led to her being declared clinically dead four days later.