DUBLIN (AP) — Sinn Fein, the Irish nationalist party, has fallen just short of becoming the largest party in elections for the Northern Ireland Assembly.

In results declared early Friday, the Democratic Unionist Party led with 28 seats, just one more than Sinn Fein’s total.

At stake in the outcome from Thursday’s snap election is the revival or demise of power-sharing between Irish Catholics and British Protestants, the central objective of the U.S.-brokered Good Friday peace accord nearly two decades ago.

Sinn Fein was seeking to overtake the Protestants of the Democratic Unionists and become the No. 1 party for the first time in Northern Ireland – an achievement that would have given Sinn Fein the right to the top government post of “first minister.”

Sinn Fein’s new leader in Northern Ireland, 40-year-old Michelle O’Neill, was mobbed by supporters as the results rolled in.

A Sinn Fein party election worker dressed up as a crocodile stands behind a banner referring to Brexit outside a polling station in Belfast on March 2, 2017 (PAUL FAITH/AFP/Getty)

O’Neill, the daughter of an Irish Republican Army veteran with childhood memories of the conflict that claimed 3,700 lives, represents a leadership shift within Sinn Fein to the first post-war generation following the IRA’s 1997 cease-fire and 2005 disarmament.

Friday’s final Northern Ireland-wide total of first-preference votes – the core measure of party popularity – showed the Democratic Unionists narrowly on top with 28.1 percent, down 1 point from the last election 10 months ago. Sinn Fein trailed with 27.9 percent, up 4 points, the narrowest sectarian gap in Northern Ireland electoral history.

Commentators credited the Sinn Fein surge to Catholic voters’ anger at the Democratic Unionists, especially outgoing First Minister Arlene Foster, who was blamed for overseeing a wasteful “green energy” program and for fostering a culture of insults and disrespect toward Sinn Fein.

Voter turnout reached nearly 65 percent, 10 points higher than last year.

Former Deputy First Minister Martin McGuinness triggered the election by resigning in January, declaring the vote a referendum on Foster’s leadership. McGuinness, a former IRA commander recently diagnosed with a rare and often fatal disease, didn’t seek re-election.