Spanish politicians are gearing up for what could be weeks of complicated negotiations after the general election resulted in a deeply fragmented parliament, with the conservative People’s party losing ground to national newcomers Podemos and Ciudadanos.

The PP won 123 seats in Sunday’s election, with 29% of the vote, leaving it far from a majority in the 350-seat legislature. Led by Mariano Rajoy, the current prime minister, the party has limited possibilities when it comes to the alliances it now needs to form a stable government majority.

The Socialists, who asserted their place as the traditional rival of the conservatives throughout the campaign, came second, with 90 seats and 22% of the vote. With many in Spain still suffering the lingering effects of an economic crisis that sent unemployment rates soaring and triggered painful austerity measures, millions of voters turned away from the PP and Socialists, who have alternated in power for decades, and instead looked to emerging parties.

Anti-austerity Podemos, barely two years old and born from the Indignado protests that saw thousands rally against a political establishment felt to be out of sync with the people, finished in third place with 69 seats and 21% of the vote, while the centre-right Ciudadanos won 40 seats and 14% of the vote. “Spain is not going to be the same anymore and we are very happy,” the Podemos leader, Pablo Iglesias, said on Sunday. “The bipartisan political system is over.” The PP and Socialists won a combined vote share of about 50%, compared with the 70-80% of past general elections.

Spanish election: Conservatives win but fall short of majority, exit polls show – live updates

Read more

Podemos did remarkably well across the country, coming first in Catalonia – where it ran in a coalition with Barcelona en Comú – and the Basque country, a result that suggested widespread support for its campaign promise to hold a referendum on Catalan independence. “Today is a historic day for Spain,” Iglesias told supporters on Sunday night. “Every time there is an election, the forces of change advance.”

Ciudadanos, launched in 2006 as a regional party to counter Catalan separatism and which expanded nationally last year, also celebrated its result on Sunday. “Today begins a new phase of hope and excitement,” said its leader, Albert Rivera. “Millions in Spain have decided that things are going to change.”

The results leave open the possibility for Rajoy to become one of the first leaders in Europe to be re-elected after imposing harsh austerity measures, but he faces a tremendous uphill battle to take power. “I’m going to try and form a government,” Rajoy told cheering supporters on Sunday as the results came in. “But it won’t be easy.”

In order to be able to govern for the next four years, the PP will have to rely on other parties, suggesting that a protracted process of negotiations lies ahead for Spain’s political leaders.

Several scenarios are possible. In the run-up to the election, many analysts had predicted that the new government would be made up of the PP and supported in some way by Ciudadanos. But now the two parties together are still short of a majority.

Any such alliance would require a third partner, a scenario that shifts some of the balance of power to regional parties from Catalonia and the Basque country and will be complicated by both parties’ vehement opposition to Catalan independence and Ciudadanos’ insistence on eradicating longstanding Basque tax benefits.

If the PP can manage to find enough support or abstentions to survive a vote of confidence, the conservatives could attempt to rule with a minority government. The option is fraught with instability, as the party will be forced to negotiate demands, ranging from constitutional reform to a referendum in Catalonia, that run counter to their electoral platform.

Many analysts pointed to a pact between the PP and Socialists – a move roundly rejected by the Socialist party on Monday, who said it would vote against having acting Prime Minister Mariano Rajoy form a new government. Such a pact would have been unprecedented for Spain and likely crippled the Socialists’ prospects in future elections.

Another alternative, echoing developments in Portugal, would be a coalition of the Socialists, Podemos and Ciudadanos. However, Rivera said this week his party would not support what he called a “grouping of losers”, diminishing the likelihood of this option. Such a coalition would clash over issues such as Catalan independence – with Ciudadanos opposed to any talk of a referendum and Podemos promising it would allow Catalans a vote on the issue – and contradict Podemos’ promises to do away with the regime that has governed Spain since the return to democracy.

'We are in uncharted waters': readers react to the Spanish general election

Read more

Sunday’s results could allow the Socialists to govern with the support of Podemos and several smaller parties, such as the Republican Left of Catalonia, which won nine seats, or Artur Mas’s Convergence party, which won eight.

If the Socialists are able to amass enough votes to gain control of the lower house of parliament, their government’s attempts to push forward initiatives such as constitutional reform would likely be quashed by the country’s senate, where the election left the PP with an absolute majority.

On Sunday evening the Socialist leader, Pedro Sánchez, congratulated Rajoy and said he would allow the conservative leader to take the first crack at forming a government: “It’s up to the first place political force to try and form a government.” But he noted that the election results had ushered in a new chapter of Spanish politics, saying: “We’re beginning a new process of dialogue and agreement.”

The election results will prompt what could be months of negotiations, said Pablo Simón, a political science professor at Madrid’s Carlos III University. “They need to talk, they need to negotiate. Anything is possible.” He pointed to the 1996 election, won by the PP and resulting in a government propped up by Catalan and Basque nationalists. “The first time PP came into power, it took two months to reach an agreement.”

Despite a result that ranks as their worst in the party’s modern history, the Socialists are now key to the question of what comes next, said Emilio Sáenz-Francés, a professor of history and international relations at Madrid’s Comillas Pontifical University. “The question is whether Sánchez will allow Rajoy to lead the government or whether Sánchez will try to build a coalition of several parties in order to take power,” said Sáenz-Francés.

He pointed to Spain’s King Felipe VI, who by mid-January will have to name the party that will have the chance to try and form a government. The candidate must then obtain an absolute majority in a vote of confidence and if they fail to do so, a simple majority vote will be held 48 hours later. If the candidate again fails to win the vote, the king must put forward a new candidate. If no government is formed within two months, new elections must be held.

Most likely the king will give Rajoy and the PP the first chance to form a government, given that it won the election, said Sáenz-Francés. “But for the first time in the history of democracy in Spain, it’s not clear how the most-voted party will be able to govern.”