Her family had sought to switch the equipment off, but doctors refused over fears they might be prosecuted under Ireland's strict restrictive abortion laws, which give the 18-week-old foetus the same constitutional rights as the mother.
Under the Irish constitution, the foetus is regarded as a citizen.
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".
In their ruling, president of the High Court Mr Justice Nicholas Kearns, Ms Justice Marie Baker and Ms Justice Caroline Costello agreed it had little chance of survival.
"The condition of the mother is failing at such a rate and to such a degree that it will not be possible for the pregnancy to progress much further or to a point where any form of live birth will be possible," they said.
Medical evidence showed the unborn foetus was facing into a "perfect storm" with no realistic prospect of emerging alive.
The woman's father took the case against Ireland's Health Service Executive (HSE) after agreeing with the woman's partner that the life support should be switched off.
"He wanted her to have a dignified death and be put to rest," the court ruling stated.
"His daughter's two children are aware that their mother is sick and believe she is being looked after by the nurses 'until the angels appear'."
The Independent has contacted The HSE, which is responsible for providing all of Ireland's public health care, for comment.
- Independent