A ruling that Northern Ireland’s restrictive abortion laws breach human rights in certain cases was overturned by a Belfast court on Thursday, the same day Britain pledged to fund terminations for Northern Irish women who travel to England.

Unlike in other parts of the United Kingdom, abortion is banned in Northern Ireland unless the life or mental health of the mother is in danger. Women can be jailed for life, as can doctors who perform abortions.

In a landmark ruling in 2015, Belfast’s High Court found that the laws breached the European Convention on Human Rights by failing to provide exceptions in cases of fatal foetal abnormality or sexual crime.

Belfast’s Court of Appeal quashed that ruling on Thursday following a challenge by Northern Ireland’s justice department and attorney general, concluding that abortion legislation should be a matter for Northern Ireland’s provincial assembly.

The board of the non-governmental Northern Ireland Human Rights Commission (NIRHC), which brought the original case, said they plan to lodge an appeal to the British Supreme Court in London.

“We first raised this issue in 2013 and remain as concerned today in 2017 that the law as it stands does not protect women and girls right to be free from torture and inhuman and degrading treatment,” NIRHC Chief Commissioner Les Allamby said in a statement.

Earlier this month, the Supreme Court narrowly upheld a ban on Britain’s National Health Service funding abortion care in England for women from Northern Ireland, out of “respect” for the decisions of the region’s assembly.

That prompted Britain’s opposition Labour Party to propose an amendment to Prime Minister Theresa May’s new legislative programme, calling for women from Northern Ireland to have access to free abortions in England.

Just as in the Republic of Ireland, where the law is equally strict, thousands of women travel to Britain from Northern Ireland every year for abortions.

The leader of Northern Ireland’s Alliance Party described the move a “helpful measure” but not a solution, as women would still have to travel and face financial costs while Northern Ireland continued to “export” the issue.

“We have got to find a solution which is respectful of the sensitivities of our society but at the same time respectful of the fact that women have to be given some degree of control over their own fertility rights,” Naomi Long told reporters.