MADRID (AP) — Spain’s political future is no clearer after a third election since 2015, with experts saying Monday that it won’t be anytime soon before the muddle is resolved.

The incumbent prime minister, Pedro Sánchez, celebrated after his Socialist party won the most votes in Sunday’s ballot. But Spanish politicians were doing the math on how Sánchez might survive the next four years without a parliamentary majority.

Spain’s political right is fractured. The traditional conservative Popular Party suffered a humiliating defeat. On the other hand, though, the election marked the rise of the far-right and a high point for an expanding center-right party.

All in all, the result did little to dispel government uncertainty in the eurozone’s No. 4 economy.

It could take weeks or months for Spain’s political future to be clarified, according to Andrew Dowling, an expert on contemporary Spanish politics at Cardiff University in Wales.

“If the Socialist party wants to stay in power for the next four years, it needs to find mechanisms of accommodation to ensure a degree of stability,” he said.

Sánchez hailed the center-left Socialists’ victory as an antidote against a reactionary wave of national populism, pledging to help strengthen the European Union.

But the Socialist party won only 29% of the vote, and it still needs to make tough political decisions in order to govern.

With only 123 seats in the 350-seat Congress of Deputies, Spain’s parliament, the Socialists will need to negotiate the support of smaller rival parties to pass legislation.

Even an alliance with the far-left, anti-austerity party United We Can — the most obvious potential partner — wouldn’t give the Socialists the key number of 176 seats.

There are other options, however.

Incumbent deputy prime minister Carmen Calvo said Monday she believed the election result, which increased the Socialists’ parliamentary seats from 85 to 123, was “more than enough” of a public endorsement to allow her Socialist party to rule alone as a minority government.

Spain’s socialists have noted the success of the Socialist administration in neighboring Portugal, where the minority government has an understanding with other left-of-center parties which provide support by often voting with it in parliament.

However, the Socialist party came to power in Spain last June in a minority government and lasted less than a year after opposition parties, including Catalonia’s separatists, refused to endorse its public spending plan.

Another possibility is a broad centrist alliance with the center-right Citizens party, which shot from 32 to 57 parliamentary seats in the election.

Citizens’ party’s leader, Albert Rivera, has in the past ruled out any arrangement with Sánchez and has in many aspects been hostile to the Socialists’ political agenda. Despite the new scenario after Sunday’s election, party Spokeswoman Inés Arrimadas on Monday repeated the

The centrist Citizens party says it wants to lead Spain’s political opposition, ruling out entering a governing alliance with the Socialists who won Sunday’s general election.

Speaking on the day after the ballot, party Spokeswoman Inés Arrimadas again rejected talks to back Sánchez, while presenting Citizens as the leading force in the opposition.

Another unpredictable path that Sánchez could consider is to seek the support of secessionists in Catalonia.

The unflagging demands of separatists for that wealthy region’s independence brought in 2017 Spain’s worst constitutional crisis in decades, and the price of their support may be too high for Sánchez.

Much of the uncertainty stems from how Spain’s political landscape has fragmented in recent years, after decades in which the Socialist party and the conservative Popular Party took turns in power.

Forging cross-party alliances has proved difficult for political negotiators and has unsettled Spanish governments. In 2015, a splintered parliamentary outcome from a general election led to inconclusive negotiations and a repeat election the following year.

“The country has endured an excessive amount of instability,” La Vanguardia newspaper said in an editorial Monday. “That is never good. And it’s even worse when the European Union has the same problem, due to Brexit and the rise of populism.”

The Popular Party lost more than half of its parliamentary representation as it fell to 66 seats.

Adding to the parliamentary makeover, the far-right Vox party claimed 10% of the vote and 24 seats. It is the first time since the 1980s that a far-right party will sit in the national parliament, albeit the national-populists didn’t score the higher results that some polls had forecast.

In all, five parties got more than 20 seats.

Referring to the anti-migrant nationalist party Vox, Sánchez said the election’s message to Europe was that “you can win against authoritarianism and regression.”

He vowed: “We will form a pro-European government to strengthen Europe, not weaken it.”

Amid all the party-political considerations, the new government faces the daunting task of cutting chronic unemployment and keeping the public pension system from collapse. The Spanish jobless rate in February was almost 14% — compared with an average of just under 8% for eurozone countries.

No immediate progress on forming a government is likely. Spain is due to elect regional and local governments, as well as its European Parliament deputies, in four weeks’ time in what will be another test of political strength.

____

Hatton reported from Lisbon, Portugal.