Sinn Féin has declared victory in Ireland’s general election and called for talks with other main parties to form a coalition government.

Its leader, Mary Lou McDonald, urged Fine Gael and Fianna Fáil to start negotiations with the republican party as the scale of its breakthrough confirmed a realignment of Irish politics.

“Sinn Féin has won the election. We have won the popular vote,” McDonald said, as counting of votes to fill seats in Dáil Éireann, parliament’s lower house, continued in constituencies across the country.

Fianna Fáil emerged with the most seats after counting was completed early on Tuesday morning. Micheál Martin’s party finished with 38 seats compared with Sinn Fein’s 37 but because the Fianna Fail speaker was re-elected without contest, both parties are effectively on the same number.

Fine Gael finished with 35 seats. Leo Varadkar, the taoiseach and party leader, faced a call from Paudie Coffey, a former Fine Gael TD and junior minister, to quit as party leader.

Simon Coveney called the voters’ verdict “harsh” but backed Varadkar’s continued leadership. Another senior party figure, Paschal Donohoe, said Fine Gael could end up forming another government.

Sinn Féin won 24.5% of the first-preference vote in Saturday’s election, almost doubling its share from 2016 after harnessing voter anger at homelessness, soaring rents and fraying public services.

Fine Gael slid to 20.9% and the main opposition party, Fianna Fáil, slipped to 22.2%, widely perceived as punishment for having propped up Varadkar’s minority administration in a confidence and supply deal.

The Greens, independents and small leftwing parties accounted for the rest. Turnout was 62.9%, down from 65.2% in the 2016 election.

The fragmented results will produce a hung parliament with no party close to 80 seats – the number for a majority and stable government in the 160-seat chamber, which includes a speaker.

McDonald told RTE her preference was to form a government without either of the two formerly biggest parties but that she would speak to Varadkar and Martin because “that’s what grownups do”.

She called for an end to the era of her party, formerly led by Gerry Adams, being frozen out of coalitions. “The democratic thing is for them to speak to me and stop this business of saying Sinn Féin can be put on the margin … So many people now have chosen us to represent them.”

McDonald later told BBC Newsnight that she should be Taoiseach as she had won the election. She said if she did become the prime minister she would start preparing for a border poll to test support for a united Ireland and would ask Boris Johnson to do the same.

Varadkar has ruled out a Fine Gael pact with Sinn Féin, citing its leftwing policies and past IRA links, and floated a centrist alliance with Fianna Fáil.

The former Fine Gael deputy leader James Reilly said the party needed to “reflect and decide” on whether Varadkar should remain leader if it does not form the next government. He told RTE there were a “number of mistakes” in a campaign “fraught with own goals” including the controversy over a proposed and then cancelled Royal Irish Constabulary commemoration.

Q&A What are the main political parties in Ireland? Show Fine Gael

Its name can be translated as family or tribe of the Irish. A centre-right party with a socially progressive tilt. In office since 2011, first led by Enda Kenny, then Leo Varadkar, with support from smaller coalition partners. Traces roots to Michael Collins and the winning side in Ireland’s 1922-23 civil war. The party traditionally advocates market economics and fiscal discipline. Appeals to the urban middle class and well-off farmers. Fianna Fáil Its name means Soldiers of Destiny. A centrist, ideologically malleable party that dominated Irish politics until it steered the Celtic Tiger economy over a cliff, prompting decade-long banishment to opposition benches. Under Micheál Martin, a nimble political veteran, it has clawed back support and may overtake Fine Gael as the biggest party and lead the next coalition government. Founded by Éamon de Valera, who backed the civil war’s losing side but turned Fianna Fáil into an election-winning machine. Sinn Féin Its name means We Ourselves, signifying Irish sovereignty. A leftwing republican party that competes in Northern Ireland as well as the Republic. Traces roots to 1905. Emerged in current form during the Troubles, when it was linked to the IRA. Peace in Northern Ireland helped Sinn Féin rebrand as a working-class advocate opposed to austerity. Under Mary Lou McDonald, a Dubliner without paramilitary baggage, Sinn Féin has become the third-biggest party, and its vote share surged in the 2020 election. Others Partnership with Fine Gael during post-Celtic Tiger austerity tainted the centre-left Labour party. The political arm of the trade union movement, it is led by Brendan Howlin, a former teacher and government minister. The Social Democrats and Solidarity-People Before Profit are part of an alphabet soup of smaller, more leftwing parties. The Greens, wiped out in 2011 after a ruinous coalition with Fianna Fáil, have campaigned on the back of climate crisis anxiety and youth-led protests. Independent TDs have prospered in recent elections, turning some into outsized players in ruling coalitions. Rory Carroll

During the campaign, Martin said Fianna Fáil would not enter government with Fine Gael or Sinn Féin but since Sunday has sounded more flexible, suggesting either scenario could happen.

Dara Calleary, Fianna Fáil’s director of elections, told RTE his party would talk with Sinn Féin about a programme for government. “We will see what programme they put together. We certainly will engage with them, we are not going to refuse to talk to them.”

Brendan Howlin, the leader of the Labour party, which appeared on course for about half a dozen seats, said any viable government would need two of the big three parties.

“Ultimately we either have to have Fianna Fáil and Fine Gael together or Sinn Féin with one of those parties. That will happen in my judgment … I think that is the only stability that can be offered.” Another election would hurt Ireland, he said.

Bread and butter issues dominated the campaign, which virtually ignored Northern Ireland and Brexit, but Sinn Féin said it wished to promote its defining issue – a united Ireland – in any future government.

An exit poll found that 57% of people supported Sinn Féin’s desire to hold referendums on unity on both sides of the border in the next five years.

At a victory celebration in a Dublin count centre, Dessie Ellis, a re-elected Sinn Féin TD and former IRA member, joined supporters in singing the rebel song Come Out Ye Black and Tans. An election count officer in Galway asked jubilant Sinn Féin supporters to lower a tricolour, saying it was neither the time nor place for symbols.

Unionist leaders in Northern Ireland have so far largely refrained from commenting on Sinn Féin’s breakthrough.

One exception is Steve Aiken, the Ulster Unionist party leader, who called Sinn Féin a hard-left party “with a less than transparent relationship with its violent past”.

Ireland faced uncertainty, he said. “Our neighbours are living in interesting, if worrying, times.”