Northern Ireland's strict abortion law breaches human rights, a High Court in Belfast has ruled.
The case was taken by 29-year-old Sarah Ewart, who was refused a termination in 2013.
She had to travel to a London clinic to end her pregnancy after doctors said her baby had a fatal defect, and would die in the womb or shortly after birth.
Mrs Justice Siobhan Keegan, who heard the case in Belfast, said: "In my view her personal testimony is compelling."
The judge followed the indication of the UK Supreme Court that abortion law in Northern Ireland was incompatible with Article 8 of the European Convention on Human Rights.
She said Ms Ewart had been affected by the current law and had a legal standing to challenge it.
The judge said: "She has had to modify her behaviour in that she could not have medical treatment in Northern Ireland due to the risk of criminal prosecution.
"She may be actively affected in the future. In my view her personal testimony is not disputed."
She said the prospect that another young woman would be required to pursue litigation and face the same "trauma and pain" should be avoided in future.
"I cannot see that this would serve any benefit or it would be right to ask another woman to relive the trauma," she added.
Ms Ewart said: "It is a massive emotional relief. This has not been an easy journey."
She added: "It is a massive victory. It has been a massive stress emotionally on the family but six years later let's enjoy today."
Abortion is illegal in Northern Ireland unless there is a direct threat to the mother's life.
It remains the only area in Ireland or the UK where abortion is so restricted.
Anybody who 'unlawfully procures or performs' a termination could potentially face life imprisonment.