MPs in Britain's House of Commons voted on Tuesday to extend same-sex marriage and abortion rights to Northern Ireland -- unless devolved government is restored there by October 21.
Campaigners hailed the move as a "big step forward" in bringing the law in socially-conservative Northern Ireland in line with the rest of the country.
However, the changes will not come into effect if the two parties that share power in Belfast, the Democratic Unionist Party (DUP) and Sinn Fein, can reach agreement in the coming months.
A dispute between them caused the devolved executive to collapse in January 2017 and, despite several rounds of talks, they remain at odds.
Abortion is currently illegal in Northern Ireland even in cases of rape, incest or when the foetus has a fatal physical defects.
The Supreme Court ruled last year that the ban was incompatible with human rights laws, although the specific case failed on a technicality.
Prime Minister Theresa May's government in London has previously argued that the issue is one that must be resolved by locally-elected politicians.
Any liberalization of the abortion or marriage laws has also been strongly opposed by the DUP, which props up May's government.
But with no sign that devolution will be restored any time soon, MPs have grown impatient, and many of May's own lawmakers backed the change.
"There's a road to go yet but today a big step forward #TheNorthISNext #LoveEquality," tweeted opposition Labour MP Stella Creasy, who led demands for abortion reform.
"Today we have said everyone in the UK deserves to be treated as an equal."
Women and equality minister Penny Mordaunt added that the vote was "a welcome step forward".
"Parliament has agreed to address the lack of access to safe abortion in Northern Ireland. We must make sure women in every part of our UK can get the care they need," she tweeted.
However, the DUP's leader in the Commons, Nigel Dodds, said the vote drove "a coach and horses through the principle of devolution, overriding the concerns of people in Northern Ireland".
- 'Marry the person they love' -
The changes were introduced as amendments to a law that delays elections in Northern Ireland to October 21 and potentially January 13, 2020, to allow further power-sharing talks.
The abortion amendment, which passed by 332 votes to 99, directs the British government to implement recommendations of a report published last year.
It said the law criminalising abortion should be repealed and the procedure legalized at least where the mother's health is at threat, in cases of rape or incest or severe fetal impairment.
The other amendment, passed by 383 votes to 73, requires the British government to introduce regulations "to provide that marriage between same-sex couples is lawful" in Northern Ireland.
The legislation must still be approved by the unelected upper House of Lords.
But Labour MP Conor McGinn, who put forward the same-sex marriage amendment, said it was "a fantastic victory".
He expressed hope that the devolved executive in Belfast would be up and running by October so it could introduce equal marriage.
"But if Stormont still isn't functioning by then, the LGBT community in Northern Ireland now know that Westminster will act to ensure equality and respect for all citizens, and finally give them the right to marry the person they love," he said.