Power-sharing in Northern Ireland has been plunged into uncertainty after Sinn Fein secured its strongest ever electoral performance after they pulled out of the devolved parliament at Stormont.

The election was called in a bid to break a stalemate between Sinn Fein and the Democratic Unionist Party (DUP) after they refused to share power. Yet rather than returning resolving the impasse, the electorate appears to have produced even starker division, raising concerns that direct rule of Northern Ireland from London may now be inevitable.

Sinn Fein has beaten even the most optimistic polling predictions behind the DUP by only 1,168 first-preference votes. The DUP came into the election with 10 more seats, but finished the count with only one more, 28 to 27. The parties have until later this month to agree to re-enter power-sharing, otherwise direct rule will have to be imposed from London.

The election was sparked after Sinn Fein refused to share power with their counterparts in the DUP, causing Stormont to collapse after a decade of functioning devolution.

Emergency elections were called in the hope of electing a fresh government that would agree to share power, but Sinn Fein and the DUP have been returned as the leading nationalist and unionist parties respectively, pushing power-sharing into deep uncertainty.

The DUP emerged from the vote count with 28 seats, Sinn Féin had 27, SDLP 12, the UUP 10, the Alliance party eight, the Greens two, People Before Profit one, the Traditional Unionist Voice one and one independent unionist.

Sinn Fein has said it will not work with the DUP while their leader Arlene Foster remains in charge and she continues to refuse to resign, making a period of direct rule all but inevitable bar a last-minute change of heart or strategy.

Speaking to The Independent following the result, Sinn Fein leader Gerry Adams said he hoped the DUP had now “learnt their lesson” that power-sharing in Northern Ireland is not guaranteed but relies on Sinn Fein cooperation.

(Getty Images (Getty Images)

He said: “We couldn’t take a position in that office without the consent of the other partner, and they can’t take the position without our consent. We hope they’ve learnt that lesson.”

Mr Adams reiterated calls for DUP leader Arlene Foster to step aside pending an independent inquiry into the “cash for ash” affair: “It’s a very serious allegation, half a billion pounds of taxpayers money as a result of corruption or fraud. It needs to be investigated, and while that’s going on, she needs to step to one side.”

He added that the ball was now in the DUP’s court whether to keep Ms Foster as leader and said he and Sinn Fein figures had extended an invitation for the two parties to meet for negotiations to determine whether they would return to power-sharing.

The republican party walked away from power-sharing in January in protest at how the DUP had handled allegations of a major financial scandal. The Renewable Heat Incentive, known locally as the “cash for ash” scandal, was a renewable energy scheme designed to encourage businesses to use environmentally friendly heat sources. However, the scheme appears to have been badly mismanaged and in fact paid companies money to burn fuel pointlessly.

The botched scheme is estimated to have cost the Northern Irish taxpayer £480m. Ms Foster was the minister in charge of the scheme at the time and has denied all wrongdoing. But she has refused to step aside as DUP leader or Northern Ireland First Minister while an independent inquiry ascertains responsibility, prompting Sinn Fein to pull out of power-sharing, citing concerns about “DUP arrogance”.

Northern Ireland: Snap election announced for Stormont Assembly

However, first-preference votes highlighted a very strong showing for Sinn Féin, at the expense of more moderate nationalist party the Social Democratic and Labour Party.

The DUP appears to have suffered palpable but not excessive losses at the polls after public outcry over the “cash for ash” scandal, with candidates seeing considerable vote drops but still meeting quotas and managing to be elected in key areas.

Northern Ireland uses an electoral system of single transferable vote, which means that votes are transferred between candidates until they reach a stipulated quota for election. The final result is therefore not expected to be calculated until Saturday afternoon.