Sinn Féin has scored dramatic gains in Ireland’s general election, according to an exit poll on Saturday night, realigning Irish politics and boosting the party’s chance of joining the next government.

The republican party won 22.3% of the vote while Leo Varadkar’s ruling Fine Gael party slumped to 22.4%, the poll said, potentially spelling an end to Varadkar’s tenure as taoiseach. Fianna Fáil, the main opposition party, won 22.2%.

If replicated in actual results it would signal an unprecedented tie among the three parties, leaving it unclear which, if any, could woo smaller parties and independents to form a parliamentary majority and ruling alliance.

Sinn Féin’s surge – up from 13.8% in the 2016 general election – reflected the anger of voters, especially among the young, at soaring rents and homelessness.

The party’s leader, Mary Lou McDonald, cast the party as a leftwing agent of change that would break up the duopoly of Fine Gael and Fianna Fáil, centrist rivals that have alternated in power for a century.

Sinn Féin, shunned by voters as the IRA’s political wing during the Troubles, also tapped voter frustration at hospital bed shortages, insurance costs, pension reform and a sense of being left behind by economic growth. The party’s agenda for Irish unification, and Northern Ireland in general, took a backseat in the campaign.

However, Sinn Féin fielded too few candidates to fully translate its surge into extra seats in the new parliament, meaning it is likely to trail Fianna Fáil and Fine Gael in the 33rd Dáil Éireann, the lower house of the Irish parliament.

The exit poll was based on a sample of 5,000 respondents and has a margin of error of 2%. Previous exit polls by Ipsos MRBI have proved reliable predictors of overall support.

However, the allocation of seats in the 160-seat chamber remains unclear. Counting of votes will begin on Sunday, with full results expected on Monday or Tuesday. No party will win an outright majority, obligating party leaders to negotiate coalitions.

Varadkar hoped a thriving economy and his handling of Brexit would deliver a third consecutive term for Fine Gael, but he encountered voter anger at the high cost of living and fraying public services. The exit poll showed support for Fine Gael, which won 25.5% in the last election, sliding but not collapsing, giving Varadkar a chance of hanging on as taoiseach.

The Fianna Fáil leader, Micheál Martin, had hoped to surf the public mood for change but the exit poll showed his party also slipping a few points – possible punishment for its confidence-and-supply deal that propped up Varadkar’s administration.

Varadkar and Martin have ruled out working with Sinn Féin, and Martin also ruled out a coalition with Fine Gael, leaving it unclear if either man will be able to muster a majority.

Both will come under pressure from some party colleagues to form a grand centrist coalition. Some Fianna Fáil members are expected to lobby Martin to make a deal with Sinn Féin. In the event of deadlock, another election looms.

Early expectations that this would be Ireland’s first climate crisis general election faltered after bread-and-butter issues dominated the campaign. However the exit poll gave the Green party 7.9%, a big jump from its 2.7% support in 2016, which will put it in contention for a place in a new government.

Storm Ciara whipped strong winds across Ireland, prompting organisers to cancel the opening ceremony for Galway’s year as European Capital of Culture, but voting precincts across the country reported strong turnout.