A majority of Northern Ireland Assembly members have voted in favour of same-sex marriage for the first time.
But the motion has been blocked after the Democratic Unionist Party (DUP) deployed a petition of concern that required the proposal to achieve a cross-community majority.
While 41 nationalists backed the proposal, it was approved by only four unionists, meaning it could not pass.
Northern Ireland is the only part of the UK where gay marriage is not legal.
Fifty-three MLAs supported the motion brought by the SDLP and Sinn Féin, while 52 voted against.
One MLA, the Ulster Unionist Party (UUP) leader Mike Nesbitt, abstained, while the SDLP's Alban Maginness was not present for the vote.
It is the fifth time same-sex marriage has been considered by the assembly.
Four earlier votes on the issue have fallen on a simple majority basis.
The previous vote, in April, was rejected by 49 MLAs, with 47 voting in favour.
Sinn Féin's Caitríona Ruane said "history had been made" with the proposal receiving majority support for the first time.
"This signals a major shift in society with more and more people supporting marriage equality for our LGBT community.
"This is a historic day but the campaign for marriage equality is not over and will not be until we have equality enshrined in legislation."
But the DUP MLA Peter Weir said many people had been "notably quick to dismiss the other four occasions that a majority rejected this same proposal".
"If it requires a process of attrition to alter a result it does not demonstrate a great deal of force behind the argument," he added.
The SDLP's Colum Eastwood said a majority of MLAs had sent a message "to the young people struggling with their sexuality that they are loved".
But he added: "The abuse of the petition of concern by the DUP in this way is wrong and it cannot continue.
"These institutions must be reformed so that no party can pervert such a critical instrument for protecting minority communities."
What is a petition of concern?
The measure was designed as a way to safeguard minority rights in Northern Ireland's power-sharing assembly.
If a petition of concern is presented to the assembly speaker, any motion or amendment will need cross-community support.
In such cases, a vote on proposed legislation will only pass if supported by a weighted majority (60%) of members voting, including at least 40% of each of the nationalist and unionist designations present and voting.
Effectively this means that, provided enough MLAs from a particular community agree, that community can exercise a veto over the assembly's decisions.
Trevor Lunn, of the Alliance Party, backed the proposal for the first time, having either opposed it or abstained from voting on previous occasions.
He said the vote had been a "moral victory" for those supporting marriage equality, but criticised the DUP's use of the petition of concern.
Kieran McCarthy was the only Alliance Party MLA to reject the motion.
Ulster Unionist Andy Allen was the only member of the two main unionist parties to support the proposal, and said his view was one of "live and let live".
But his party leader, Mr Nesbitt, said he had abstained as the vote had been "rendered utterly meaningless by the DUP's pre-cooked petition of concern".
John O'Doherty, director of the Rainbow Project, an LGBT support organisation, said, it had been a "momentous day".
The human rights organisation Amnesty International said the "battle for equality in Northern Ireland will now move to the courts".
Two couples won permission in June to challenge Northern Ireland's ban on same-sex marriage by way of a judicial review.
Patrick Corrigan, of Amnesty International, said the majority vote showed that "slowly but surely, politicians are catching up with public opinion".