LONDON — Six years after Britain voted to leave the European Union, no part of the United Kingdom has felt the sting in the tail more than Northern Ireland, where Brexit laid the groundwork for Sinn Fein’s remarkable rise in legislative elections this week.
With almost all of the votes counted on Saturday, Sinn Fein, the main Irish nationalist party, declared victory, racking up 27 of the 90 seats available in the Northern Ireland Assembly, the most of any party in the territory. The Democratic Unionist Party, which represents those who want Northern Ireland to remain part of the United Kingdom, slipped to second place, with 24 seats.
“Today ushers in a new era which I believe presents us all with an opportunity to reimagine relationships in this society on the basis of fairness, on the basis of equality and on the basis of social justice,” said Michelle O’Neill, the party’s leader who is set to become the region’s first minister.
Though Brexit was not on the ballot, it cast a long shadow over the campaign, particularly for the D.U.P., the flagship unionist party that has been at the helm of Northern Ireland’s power-sharing government since it was created by the Good Friday peace agreement nearly a quarter-century ago.
Brexit’s legacy rippled through local elections across the British Isles: In London, where anti-Brexit voters turned Conservative Party bastions over to the Labour Party, and in the “red wall,” England’s pro-Brexit rust belt regions, where the Conservatives held off Labour. But in Northern Ireland, Brexit’s effect was decisive.
For all of the history of Sinn Fein’s victory — the first for a party that calls for a united Ireland and has vestigial ties to the Irish Republican Army — the election results are less a breakthrough for Irish nationalism than a marker of the demoralization of unionist voters, the disarray of their leaders, and an electorate that put more of a priority on economic issues than sectarian struggles.
Much of that can be traced to Brexit.
“Coming to terms with the loss of supremacy is an awful lot for unionism to process,” said Diarmaid Ferriter, a professor of modern Irish history at University College Dublin. “But the unionists really managed to shoot themselves in the foot.”
The D.U.P. struggled to hold together voters who are divided and angry over the North’s altered status — it is the only member of the United Kingdom that shares a border with the Republic of Ireland, a member of the European Union.
That hybrid status has complicated life in many ways, most notably in necessitating a complex trading arrangement, the Northern Ireland Protocol, which imposes border checks on goods flowing to Northern Ireland from mainland Britain. Many unionists complain that it has driven a wedge between them and the rest of the United Kingdom by effectively creating a border in the Irish Sea.
The D.U.P. endorsed the protocol, only to turn against it later and pull out of the last Northern Ireland government in protest. Unionist voters punished it for that U-turn, with some voting for a more hard-line unionist party and others turning to a nonsectarian centrist party, the Alliance, which also scored major gains.
The success of the Alliance, political analysts said, suggests that Northern Ireland may be moving beyond the sectarian furies of the past and a binary division between unionists and nationalists.
Even Sinn Fein, which for decades was associated with the bloodstained struggle for Irish unity, said little about the topic during the campaign, keeping the focus on bread-and-butter issues like jobs, the cost of living and the overburdened health care system.
With the 25th anniversary of the Good Friday accord approaching, some analysts said it was time to revisit the North’s political structure.
The agreement ended decades of sectarian strife by, among other things, creating an open border on the island. But it also balanced political power between the nationalists and unionists, at a time when the predominantly Protestant unionists were the majority and the predominantly Catholic nationalists were a restive minority.
Demographic trends have changed that: The faster-growing Catholic population is poised to overtake the Protestants. While the link between religion and political identification is not automatic — there are some Catholics who favor staying in the United Kingdom — the trends favored the nationalists, even before Brexit.
As the largest party, Sinn Fein will have the right to name a first minister, the symbolic top official in the government. But the final seat count between nationalists and unionists is likely to be close, since the two other unionist parties won a handful of seats, and the one other party that designates itself as nationalist, the Social Democratic and Labour Party, performed poorly.
As the runner-up, the D.U.P. is entitled to name a deputy first minister, who functions as a de facto equal. Even so, it has not committed to taking part in a government with a Sinn Fein first minister. And it has threatened to boycott until the protocol is scrapped, a position that draws scant support beyond its hard-core base.
“There’s fragmentation within parties that are trying to reflect a more secular Northern Ireland,” said Katy Hayward, a professor of politics at Queen’s University in Belfast. “That fits uncomfortably with the architects of the peace agreement. There’s no dominant group now. We’re all minorities.”
In this more complex landscape, Professor Hayward said, Sinn Fein was likely to govern much as it campaigned, by focusing on competent management and sound policies rather than mobilizing an urgent campaign for Irish unity.
Ms. O’Neill, the Sinn Fein leader in Northern Ireland, hailed what she called “the election of a generation.” But she said little about Irish unity. Sinn Fein’s overall leader, Mary Lou McDonald, said this week that she could foresee a referendum on Irish unification within a decade, and possibly “within a five-year time frame.”
For the unionists, the path out of the wilderness is harder to chart. Professor Hayward said the D.U.P. faced a difficult choice in whether to take part in the next government.
If it refuses, it would be violating the spirit of the Good Friday Agreement. It would also risk further alienating voters, particularly “soft unionists,” who have little patience for continued paralysis in the government.
But if it joins the next government, that brings its own perils. The D.U.P. swung to the right during the campaign to fend off a challenge from the more hard-line Traditional Unionist Voice party. It has made its opposition to the Northern Ireland Protocol an article of faith.
“There may be serious talks now about unionist unity, but there will be no government unless the protocol goes,” said David Campbell, chairman of the Loyalist Communities Council, which represents a group of pro-union paramilitary groups that vehemently oppose the protocol.
That puts the D.U.P.’s future out of its hands, since the decision to overhaul the protocol lies with the British government. Prime Minister Boris Johnson has signaled that he is open to doing that — especially if it would facilitate a new Northern Ireland government — but he must weigh other considerations.
Overturning the protocol would raise tensions with the European Union and even risk igniting a trade war, a stark prospect at a time when Britain already faces soaring inflation and warnings that its economy might fall into recession later this year.
It would also antagonize the United States, which has warned Mr. Johnson not to do anything that would jeopardize the Good Friday Agreement.
“The Biden administration has made it very clear that the protocol is not a threat to the Good Friday Agreement,” said Bobby McDonagh, a former Irish ambassador to Britain. “It actually helps support the Good Friday Agreement. That will act as a sort of constraint on Johnson.”