MADRID (Reuters) -No clear winner emerged in a nailbiting finish to Spain's election on Sunday as the right failed to fulfill predictions of a victory big enough to push Prime Minister Pedro Sanchez from power.
The two leading parties will seek to negotiate coalition deals in pursuit of a governing majority but analysts warned the process could end in a hung parliament and another election.
With 100% of votes counted by 1:30 a.m. on Monday (2330 GMT), the opposition center-right People's Party (PP) had 136 seats in parliament while Sanchez ruling Socialists (PSOE) had 122 seats.
Both were short of the 176 seats needed to govern. But the Socialists performed better than forecast while the PP failed to clinch a predicted clear majority, injecting drama into the vote counting.
The parties with the greatest potential to be kingmakers were nearly even with far-right Vox on 33 and far-left Sumar on 31 seats.
The result meant that Sanchez went from likely outgoing premier to a potential contender to form another government. It also all but torpedoed the prospect of a far-right party taking part in another European government as pollsters had projected with a PP and Vox coalition.
The Teneo advisory firm put Sanchez' odds of forming a coalition far above those of PP leader Alberto Nuñez Feijoo, with a 45% probability he could negotiate a deal with far-left Sumar and smaller parties. But it assigned the same percentage probability to a new election being required.
The lack of a clear result cast a shadow on Spain's current presidency of the European Union council and risked unsettling markets.
Speaking to jubilant supporters outside the PSOE's central Madrid headquarters late on Sunday, Sanchez said Spaniards had rejected the "backward-looking bloc, which proposed a total repeal of all the progress we have made over the last four years."
In a more muted address at the PP headquarters across town, Feijoo insisted his party had won the election and would seek to avoid uncertainty by speaking to all willing parties to form a government. Vox leader Santiago Abascal said Sanchez could block any attempt by the right to form a government.
King Felipe VI will invite Feijoo, the top vote winner, to try to secure the prime ministership. In a similar situation in 2015, PP leader Mariano Rajoy declined the king's invitation, saying he could not muster the support.
If Feijoo declines, the king may turn to Sanchez with the same request. The law does not set a deadline for the process but if no candidate secures a majority within two months of the first vote on the prime minister, new elections must be held.
Sanchez called a surprise snap election after the left took a drubbing in local elections in May.
Sunday's vote coincided with what would have been many Spaniards' summer holidays and one of the hottest months in the sunbaked nation. Voters showed up in swimsuits and used ballots as fans while polling stations brought in air conditioners or moved voting tables outside.
Turnout was up, at 70.40% compared to 66.23% in the last election in 2019.
Polls in the weeks leading up to voting - and even those released as the final ballot box was sealed at 9 p.m. - predicted a working majority for Feijoo's PP and Vox.
Ignacio Jurado, political science professor at Madrid's Carlos III University, blamed the PP's negative campaign against Sanchez for a drop in support and said Sanchez's abrupt move in calling snap elections might still pay off.
"The PP needed something more, especially because Vox is a hindrance," he said.
'NOT LOOKING GOOD'
As the results rolled in on Sunday night, a mood of jubilation outside the PP headquarters turned anxious as the gap between the PP and PSOE remained stubbornly slim.
Galo Contreras, PP mayor of a town in the northern Burgos province, said he was not surprised the race was so close given missteps by the PP in the last week.
Each seat gained for the PP was loudly celebrated by the crowd of supporters. But one admitted as the night went on: "This isn't looking good."
Meanwhile, at the Socialists' headquarters, some senior officials were smiling. A supporter in the corridor said gleefully: "We were dead but we're now alive."
Feijoo could try to persuade smaller parties to back a PP-Vox coalition. But many appear reluctant to support the ascent of a far-right party into power for the first time since the four-decade rule of dictator Francisco Franco, who died in 1975.
Sanchez has more options for negotiations but may still struggle to cobble together a majority, with potential allies looking for concessions in return for their support.
In the present scenario, Sanchez's PSOE would rely heavily on Catalan separatist parties Junts and ERC or Basque separatists EH Bildu.
Junts' main candidate recently said the party would seek a new vote on Catalan independence in return for coalition support, while the region's former leader, Carles Puigdemont, has said he would support neither Sanchez nor Feijoo.
Jose Ignacio Torreblanca, director of the Madrid office of the European Council on Foreign Relations, said Spain was now faced with "a catastrophic tie".
(Reporting by Pietro Lombardi, Corina Pons, Belen Carreno, David Latona and Emma Pinedo, additional reporting by Jesus Aguado and Joan Faus; Writing by Charlie Devereux and Aislinn Laing; Graphics by Andrei Khalip; Editing by Nick Macfie, Frances Kerry and Cynthia Osterman)