DUBLIN – Ireland’s left-wing nationalist Sinn Fein party shattered the country’s center-right status quo with its strongest-ever performance in this weekend’s general election, throwing Irish politics into uncertainty.

Exit polls and early vote counts showed Sinn Fein on par with or ahead of the two mainstream parties that have dominated Irish politics for nearly a century, with young voters embracing the long-marginalized party en masse.

The center-right Fine Gael party of Prime Minister Leo Varadkar suffered humiliating losses. In an embarrassing turn of events, Varadkar was outperformed by the left-wing nationalists in his own constituency, though he is expected to keep his seat under Irish electoral rules.

“This is no longer a two-party system,” said Mary Lou McDonald, leader of Sinn Fein, the former political wing of the Irish Republican Army (IRA).

Vote counting was expected to continue throughout Sunday and probably Monday, but no party appeared to have an easy path to forming a majority government. A second election could be needed if no breakthrough is reached.

McDonald indicated that she would first seek to form a government with smaller parties. Meanwhile, the leader of the center-right Fianna Fail party, Micheál Martin, said there is “an obligation on all” to ensure the formation of a functioning government.

Martin did not explicitly address the key question, however, of whether such a government could include Sinn Fein. At least one of his party’s members of Parliament pondered that possibility Sunday.

But ahead of the election, Martin and Fine Gael leader Varadkar had both insisted they were not inclined to govern with the left-wing nationalists.

For the two center-right parties, Sinn Fein’s historical association with the IRA still weighs heavily. The IRA, loyalist paramilitaries and British troops killed about 3,600 people during the conflict known as the Troubles, which centered on the IRA’s campaign to force an end to British rule in Northern Ireland from the 1960s until the late 1990s. It continues to haunt Irish politics, especially as Britain’s recent departure from the European Union has raised new concerns that Irish peace could be at risk.

Brexit played a minor role in Ireland’s Saturday election, following a campaign that was largely dominated by housing and health care, among other issues. Sinn Fein’s McDonald appeared to capitalize on voters’ frustration with the country’s two center-right parties and increasing support for left-wing economic policies.

Brought up in a middle-class suburb of Dublin, McDonald, 50, framed herself as a progressive, urban leader in an effort to move the party on from its controversial roots.

That strategy appeared to have worked. As her supporters waited for McDonald to arrive at a Dublin tally center Sunday afternoon, they enthusiastically chanted, “Hello Mary Lou” – the 1961 song recorded by Ricky Nelson.

Sinn Fein campaigned on a mix of nationalist proposals – including a reunification referendum – and left-wing stances, such as higher taxation of global corporations, a boost in public spending and residential rent freezes.

Even though Ireland’s economy is doing better than at any point since the 2008 financial crisis, many voters said they felt they had been left behind. Some average rents in the capital, Dublin, now exceed those in Tokyo, but wage growth has been sluggish.

“Whereas the government would say the economy is doing well, a lot of people feel they haven’t achieved benefit from it,” said Irish News columnist and political commentator Deaglán de Bréadún. “Virtually everywhere you go in Dublin, for example, you will pass a location where someone is sleeping in a tent.”

In the center of Dublin, voters echoed that sentiment Sunday.

“Homelessness and crime are a big thing, and the two big parties are not helping with that,” said 52-year-old Michael Doyle, who used to support Varadkar’s center-right party but voted for Sinn Fein for the first time Saturday.

Kevin Burns, a 26-year old Sinn Fein youth-wing activist, said the party “spoke to the issues that are affecting everybody in this country,” adding: “The housing crisis and the health care crisis, these things didn’t fall from the sky.”

“This is a consequence of what happens when you prioritize corporations and a lower tax economy and bailing out the banks,” Burns said.

The rapid gains in support for Sinn Fein appeared to have caught the party itself by surprise. After weak results in local elections last year, the party fielded 42 candidates – about half as many as Fine Gael and Fianna Fail (the Irish Republican Party) each put forward and probably fewer than needed to fully capitalize on Saturday’s results. The threshold to form a majority government is 80 seats.

If Sinn Fein were to be included in a coalition in Dublin, it would become the first major party represented in both Northern Ireland’s government, where it is the second largest party, and the Irish government.

It may also spell the end of Varadkar’s ambitions.

When campaigning got underway last month, the prime minister still appeared confident about his chances of maintaining power. Abroad, his profile had steadily risen since he became premier in 2017 at age 38, the youngest-ever Irish leader. The trained doctor backed grass-roots campaigns that pushed through the legalization of same-sex marriage and abortions, navigated difficult Brexit negotiations with the E.U. and Britain and oversaw a phase of economic recovery.

“Varadkar and the government put a lot of emphasis on Brexit and the fact that they got a commitment from Boris Johnson that there would be no return to a hard border with customs posts,” along the border with Northern Ireland, said de Bréadún, the columnist.

In other E.U. capitals, Ireland was increasingly seen as a new liberal role model in recent years – with the gay and dual-heritage Varadkar as its poster boy.

But in the country of almost 5 million, Varadkar’s leadership position hung by a thread. He was able to govern only because his center-right competitor Fianna Fáil had entered into a loose deal to keep the government in power in 2016.

Polls showed support for his party dropping from about 30% to 21% between November and February.

Varadkar’s Brexit maneuvers “did not register with the public,” de Bréadún said.

– – –

Noack reported from Dresden, Germany.