The woman, who cannot be named, was refused an abortion when she demanded a termination at eight weeks, saying she was suicidal.

The case is the first proper test of Ireland's 2013 Protection of Life During Pregnancy Act, which allows for abortions in Irish hospitals in limited circumstances.

Those include the woman's life being in danger if the pregnancy went to full term and where she is suicidal in such instances as rape and incest.

Critics say the law has proved of no practical value to the woman in this case.

Dr Mary Favier of Doctors for Choice said the refusal of a medical panel to allow the termination, despite agreeing she was suicidal, meant despite the new law, few women would be able to get an abortion.

"If we accept the figures that approximately 3,500 women have abortions in the UK each year, they are excluded, and then rape and incest victims, and those with foetal anomalies are also excluded, and now it seems effectively those at suicide risk," she said.

A friend of the woman told the Irish Times the woman, an immigrant, became pregnant after being raped in her own country. She discovered she was pregnant a few weeks after arriving in Ireland this year and told her friends: "I do not want this. I am too young to be a mother. I am not ready."

Her friend said the woman was not given information on how to obtain an abortion, and as the pregnancy continued she became increasingly distressed.

The friend said the woman was advised to go to a local doctor, which she did in mid-July. The GP gave her a letter for a hospital, the friend said, and she was admitted. She was told in hospital on 22 July that an abortion was not possible as the pregnancy was too far advanced.

Her friend confirmed that the woman had first asked for a termination when she was eight weeks pregnant.

After the woman threatened to go on hunger strike to protest against the decision, local health authorities obtained a court order to deliver the baby prematurely – at about 25 weeks, according to some reports – to ensure its safety. The infant has been placed in care.

The case highlights medical guidelines given to Irish doctors, which the Guardian obtained this month and which pro-choice organisations including medical experts said at the time would put up huge barriers to women seeking abortions because they are suicidal. The guidelines mean that women seeking an abortion could need approval from up to seven experts.

A pro-choice group of Irish medics said her case highlighted the need to repeal the eighth amendment of the Irish constitution, which effectively makes an unborn foetus, even at the point of conception, a citizen of the republic. Doctors for Choice said the case underlined the inherent flaws in the 2013 act, which seeks to balance a woman's rights with those of a foetus.

"If a young rape victim, certified as requiring an abortion due to the risk of suicide, cannot access abortion services, then the legislation and its implementation are clearly fatally flawed. Repealing the eighth amendment in an urgent referendum and decriminalising abortion have now achieved emergency status," the group said.

Pro-choice campaigners have also demanded to know whether the woman was given the option of travelling to the UK for an abortion.