Despite requests from the woman's family for her to be allowed to die, doctors continued life support as the Irish constitution says a woman and her unborn child have an equal right to life.
The woman was 14 weeks pregnant when she was declared clinically dead on December 3 after suffering a brain injury. She has been on life support since but is "deteriorating rapidly", the court heard.
The case touched on a deeply divisive issue in Ireland, which has a controversial constitutional ban on abortion, with even the head of the Catholic Church in the country saying, "A woman isn't simply an incubator."
"To maintain and continue the present somatic support for the mother would deprive her of dignity in death and subject her father, her partner and her young children to unimaginable distress," the judgement said.
More From This Section
The case reignited fierce social tensions in majority Catholic Ireland over the rights of unborn children, prompting the Archbishop of Dublin Diarmuid Martin to speak out on the issue.
In a statement following the judgement, the Irish health service welcomed the judgement and expressed "deepest sympathy to the family... In the tragic and extremely difficult situation they have found themselves in."
Though intended to outlaw abortion, the wording of the amendment does not refer specifically to termination and affords equal rights to a woman and her unborn child "as far as practicable".
"The (court's) decision was based on the absence of a realistic prospect of a live birth," Conor O'Mahony, a senior lecturer in constitutional law at University College Cork wrote in an analysis of the judgement.
In 2013, after another divisive debate and a supreme court ruling, Dublin introduced new laws allowing for terminations in limited circumstances if the life of the mother was at risk.
Halappanavar had sought a termination when told she was miscarrying, but the request was refused as the foetus was alive and her life appeared not to be in danger. She died of blood poisoning days after miscarrying.