DUBLIN — Ireland braced for weeks of political uncertainty Monday after an stunning election that saw the Irish Republican Army-linked party Sinn Féin — long shunned by its bigger rivals — take the largest share of votes.
In a surge that upended Ireland’s traditional two-party system, the left-wing nationalist party beat both Fianna Fail and Fine Gael, the centrist parties that have governed Ireland since it won independence from Britain a century ago.
The vote in Saturday’s election essentially split three ways, complicating the negotiations on forming a government that lie ahead.
Sinn Féin received 24.5 percent of the first-preference votes, besting the two long-dominant parties. Fianna Fail received 22.2 percent of the votes. Fine Gael, the party of incumbent Prime Minister Leo Varadkar, got 20.9 percent.
“I think it’s a mess, to be honest with you,’’ said Pat O’Toole, a public sector worker in Dublin. ‘‘I think we’re going to be in a situation again where we are not going to be able to form a stable government in this country. I really don’t know what’s going to happen.”
Sinn Féin’s left-wing proposals for tackling Ireland’s housing crisis and creaking health care system proved to be a powerful draw for young voters in a country that is still dealing with aftershocks of the 2008 global financial crisis, which hammered its debt-driven “Celtic Tiger” economy.
Both Fianna Fail and Fine Gael said before the election that they would not go into a coalition with Sinn Fein because of its links to past violence.
Varadkar said Fine Gael’s stance was unchanged.
‘‘I say what I mean and I mean what I say,’’ he said Monday.
But as the scale of Sinn Fein’s surge became clear, Fianna Fail leader Micheal Martin said: “I’m a democrat.”
“I listen to the people. I respect the decision of the people,” he told Irish broadcaster RTE.
Talks among the parties are likely to take weeks, though some hope a new government can be formed by St. Patrick’s Day on March 17, when the Irish prime minister traditionally visits the White House.
Sinn Féin leader Mary Lou McDonald suggested her party could try to form a government with the support of independents and smaller parties such as the Social Democrats and Labour.
“We want to talk to anyone who is interested in delivering a program for government, that is about getting to grips with the housing crisis and solving it, getting to grips with the crisis in health and giving families and workers a break and giving a new lease of life to government,” she said.
The IRA was responsible for murders, bombings, and other violence for decades during decades known as the “Troubles” in Northern Ireland. More than 3,500 people were killed in conflict between forces that sought to reunify Northern Ireland with the Republic of Ireland and those who wanted Northern Ireland to remain part of the United Kingdom.
Eoin O’Malley, associate professor of political science at Dublin City University, said the party’s past meant little to younger voters without memories of living through the Troubles. He said Sinn Féin had offered the clearest message on social problems in Ireland, which include a growing homelessness crisis, house prices that have risen faster than incomes, and a public health system that hasn’t kept up with demand.
Still, Sinn Féin’s triumph could have implications for Ireland and the UK. The party’s struggle for a united Ireland was on the back burner during the election, but it is calling for a referendum on reunification within five years.
That is not something an Irish government can deliver without the support of Britain and Northern Ireland — highly unlikely in the short term. But Brexit looks likely to nudge Northern Ireland’s economy closer to that of its southern neighbor and could increase pressure for a vote on unification.
In London, Prime Minister Boris Johnson’s spokesman, James Slack, said the UK was “following the results of the Irish election carefully.’’
He insisted that ‘‘the close relationship between the UK and Ireland will continue regardless of the election result.”