The law on abortion in Northern Ireland is an anomaly that should have been dealt with long ago. The near-total ban, dating back to 1861 and including abortion in cases of rape, incest and fatal foetal abnormality, is among the most restrictive in the world. It is also an affront to the rights of women – as both the UK supreme court and a United Nations committee ruled separately last year.

Since abortion is a devolved issue, and the proper business of the Stormont assembly rather than the UK parliament, Tuesday’s House of Commons vote in favour of liberalisation was not the ideal way to resolve an appalling situation. Given the circumstances, with power-sharing at Stormont suspended in 2017 and human rights violations ongoing, it was a humane and constructive step. Labour’s Stella Creasy deserves credit for her tenacity in pushing for it. That Conor McGinn’s amendment to extend same-sex marriage to Northern Ireland also passed by a huge majority made the news all the sweeter. This was a day of celebration for many Northern Irish people, as Sara Canning, partner of the murdered journalist and LGBT rights campaigner Lyra McKee, explained in an article for the Guardian.

The equal marriage amendment should pass into law in October, if the devolved government remains suspended. A restored assembly would then be entitled either to approve or repeal it. But the latter is unlikely given that the assembly has already voted for equal marriage in 2015, only for the DUP to use its parliamentary veto to block it. Abortion campaigners anticipate a struggle, beginning in the House of Lords. Polling following last year’s Irish abortion referendum showed that a majority in Northern Ireland now backs legal abortion. But opposition remains stronger than to gay marriage, and the DUP may attempt to block or delay it. There are also practical questions about how to equip hospitals and clinics to provide the service. In the Republic this was achieved in less than a year, but would be more difficult without strong backing from local politicians and health officials. Last year 1,053 women travelled to England for abortions, which since 2017 have been paid for by the UK government. Just 12 were performed in Northern Ireland because the mother’s health was deemed to be at risk (the only criterion under which abortion is currently allowed).

Two court cases are certain to have an impact. A ruling is expected shortly in Belfast on one brought by Sarah Ewart, who was forced to travel to England for an abortion when the foetus she was carrying was found to have a fatal defect. Ms Ewart aims to have Northern Ireland’s laws declared in breach of the European convention on human rights (her case was previously heard at the supreme court but failed on a technicality, although the judges made clear their disapproval of the status quo). The second case is that of a woman being prosecuted for buying abortion pills for her 14-year-old daughter, who became pregnant through rape, with a trial date in November.

Such a prosecution is self-evidently a heartless anachronism. The hope is that, once abortion has been made legal, prosecutors will call it off. As with gay marriage, Northern Irish politicians must have the final say on abortion if and when Stormont is resurrected. Until then, any attempts to derail what has been agreed by MPs must be resisted. Even though there are still hurdles to clear on the road to legal abortion and equal marriage, this week’s votes by big cross-party majorities are enormously cheering. Despite the recent rise in hate crime and many cruel inequalities, we are in some ways a kinder and more accepting nation than we were.