Ireland’s high court ruled that doctors can switch off the life support machine of a brain-dead woman who is 18 weeks pregnant, leading to calls for increased clarity over medical guidelines on abortion in the country.

The landmark judgment is a challenge to the Irish constitution, which gives a mother and an unborn child equal rights, and led pro-choice campaigners to demand a referendum on the issue.

On Friday the three judges, Mr Justice Nicholas Kearns, Ms Justice Marie Baker and Ms Justice Caroline Costello, granted the woman’s family’s wish that she be allowed to die.

Her doctors had refused to switch off her life support for fear they could be prosecuted under Ireland’s strict abortion laws.

But Kearns said the court “is satisfied, in the circumstances of this case, that it is in the best interests 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”.

The judge added: “To maintain and continue the present somatic support for the mother would deprive her of dignity 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 consequences.”

The father of the woman at the centre of the controversy told the court on Tuesday: “My daughter is dead, the chances of the foetus surviving are minimal, we have been told. I want her to have dignity and be put to rest.”

When he was informed that his daughter was being kept on life support to save the unborn child, the father said he found the doctors’ decision “extremely distressful”. His daughter has been clinically brain-dead since suffering a head injury in a fall in November. She was declared clinically dead on 9 December.

The woman’s partner was also in court, and said that he supported the family’s decision to ask for life support to be switched off.

Under the 8th amendment of the Irish constitution the unborn child has the same rights as its mother even in this case.

But a spokesperson for the Irish Health Service Executive admitted on Friday that the constitution was not designed to cope with cases where a brain dead woman was kept alive because she was pregnant. He said there would have to be “a degree of clarity” brought to medical guidelines about such cases.

This admission will bolster pro-choice arguments that a new constitutional referendum is needed in relation to abortion in Ireland.

All the medical experts who gave evidence in the case earlier this week said the chances of the unborn child surviving were minimal. Intensive care specialist Dr Brian Marsh said the view of medical science was that the woman was now a corpse. “I don’t believe this unborn baby can survive,” Marsh told the high court earlier this week.

Another medical expert, consultant obstetrician Dr Peter Boylan, said the medical team treating the woman at present were in uncharted territory. Boylan said they had been right to seek legal advice but that the removal of article 8 of the constitution would be helpful.

Ireland’s Health Service Executive also told the judges that given the medical evidence the court should make an order ruling that discontinuing treatment would be lawful.

The 8th amendment “acknowledges the right to life of the unborn and, with due regard to the equal right to life of the mother, guarantees in its laws to respect and, as far as practicable by its laws, to defend and vindicate that right”. It was passed in 1983 after pressure from an alliance of anti-abortion and religious groups who forced through and won a referendum to change the Irish constitution.

Pro-choice campaigners and some doctors have argued that in order to avoid controversies like the current one the 8th amendment must be abolished.

• This article was amended on 29 December 2014. An earlier version made a reference to the “8th article” of the Irish Constitution. This has been corrected.

