The High Court has ruled there is nothing to prevent a 17-year-old girl in the care of the Health Service Executive from travelling abroad for an abortion.
The girl, known as Miss D, is four months pregnant with a child who cannot survive after birth.
Mr Justice Liam McKechnie also criticised the HSE for its actions after the girl told her social worker she wanted an abortion.
He said he firmly and unequivocally held the view that there was no statutory or constitutional impediment to Miss D travelling for the purposes of terminating her pregnancy, if that was what she wanted.
He said this case was not about abortion; it was about the right to travel.
He spoke of Miss D's devastation on seeing on an ultrasound scan that the child she was carrying had no head. The foetus is suffering from anencephaly, a condition where a major part of the brain is missing.
And he said Miss D had showed courage, integrity and maturity and had also displayed sound moral judgment by refusing to say she was suicidal when she was not.
He said it was likely that the HSE had tried to shoehorn her case into the grounds set out in the X case - that abortion is only legal if the mother's life is at risk or if she is suicidal.
And he said it was likely the HSE had done this to avoid having to make any public or controversial decision.
There was no law allowing the HSE to prevent her from travelling he said and no law stating that she needed the active permission of the district court to go. Miss D was not in court for the ruling.
HSE accepts ruling
The Health Service Executive has said it accepts the High Court decision.
The HSE also said it acted in accordance with what it believed to be the correct course of action in terms of the legal constraints.
The Pro-Life Campaign said the case was a reminder of the urgent obligation on society to ensure that every possible support is put in place so that no woman feels abortion is the only option open to her.
Pro-choice groups have said it is time for politicians to face up to the abortion issue.