DUBLIN — Northern Ireland’s snap election has left the rival extremes of politics virtually neck and neck for the first time — and facing a bruising battle to put their Catholic-Protestant government back together again in an increasingly polarized landscape.

The big winner from Saturday’s final results to fill the Northern Ireland Assembly is the Irish nationalist party that triggered the vote, Sinn Fein.

Already the major voice for the Catholic side, Sinn Fein reduced its previous 10-seat gap with its erstwhile Protestant colleagues in government to a single seat in a 90-member chamber. Sinn Fein came within 1,168 votes province-wide of becoming the most popular party for the first time in a corner of the United Kingdom that its leaders long sought to make ungovernable through Irish Republican Army carnage.

The party’s new leader in Northern Ireland, Michelle O’Neill, called the outcome “a great day for equality.”

In another first, the leading British Protestant party, the Democratic Unionists, won’t have enough votes to block legislation on its own, a power long employed to block gay rights legislation backed by all other parties. Never before has the Protestant side’s status as the in-built majority in Northern Ireland felt so precarious.

The outcome from Thursday’s election, forced by a surprise Sinn Fein withdrawal that collapsed the previous unity government, caught other parties off guard. The Democratic Unionists finished with 28 seats, Sinn Fein 27. The political affiliations of smaller parties meant the new assembly will have 40 unionists committed to keeping Northern Ireland in the United Kingdom versus 39 nationalists seeking to merge the once Protestant-dominated north into the Republic of Ireland.

The whole point of power-sharing — the central goal of Northern Ireland’s 1998 peace accord — is to promote compromise between two evenly balanced blocs. But analysts and politicians from all factions agreed Saturday that they cannot see any quick revival of cooperation between two parties that, against the odds of history, had governed Northern Ireland in surprising stability until their partnership unraveled spectacularly over the past year.

Sinn Fein leaders said Saturday’s result meant the day was drawing closer for an all-Ireland referendum on uniting the island politically outside the U.K., an issue given greater importance because of Britain’s determination to withdraw from the European Union. Northern Ireland is heavily dependent on EU aid, a majority of its voters rejected “Brexit” in last year’s U.K.-wide referendum, and only the Democratic Unionists supported the move.

The immediate question facing all sides is whether the new assembly, when it meets for the first time Monday, will have a life beyond a few weeks of uncompromising, fruitless negotiations. Sinn Fein is demanding that the Democratic Unionists’ leader, Arlene Foster, step aside as a first condition on forging any new alliance.

Publicly, Democratic Unionist lawmakers say they won’t let Sinn Fein dictate who their own leader should be. Privately, many hope Foster — a combative speaker known for mocking opponents rather than building bridges — will resign voluntarily after barely a year on top. She stumbled trying to defend her oversight role in a wasteful “green energy” scheme that funneled tens of millions in subsidy payments to chicken farmers, including relatives of party figures.

“People knew we were in a difficult place and sought to kick us when we were down, but we were tough enough to come through it,” said DUP lawmaker Edwin Poots. “We will lead for Northern Ireland and we will not let our case go by default. Sinn Fein can be absolutely assured that there will be no caving in to them.”

If the two sides cannot quickly come together, Britain would be obliged to step in and resume governing the territory from London. That system, known as “direct rule,” supposedly ended for good when Sinn Fein and the Democratic Unionists struck a stunning power-sharing pact between lifelong enemies in 2007.

Prime Minister Theresa May’s government has made clear it doesn’t want Northern Ireland back on its plate full time while it focused on plans to leave the EU.

The moderate forces that led Northern Ireland’s first power-sharing government from 1999 to 2002, the Ulster Unionists and the Catholic-backed Social Democratic and Labour Party, won 10 and 12 seats respectively. The only traditional party seeking support equally from both sides of the divide, Alliance, won eight.

Ulster Unionist leader Mike Nesbitt announced his resignation Friday night. He said the failure of more reasonable middle-ground politicians to achieve any breakthrough demonstrated “that this society is now more polarized than ever.”

“Someday, Northern Ireland will vote as a normal democracy. We will vote in a post-sectarian election,” Nesbitt said. “But it is now clear that it will not happen during the duration of my political life.”