A week of protests by Spaniards fed up with the stagnant economy and the EU's highest jobless rate preceded Sunday's elections, which left the Socialists out of power in most of the country's cities and almost all the 17 autonomous regions.
Pressure could now grow from inside and outside the Socialist party for Prime Minister Jose Luis Rodriguez Zapatero to call early elections, though he vowed on Sunday night to hang on to the end of his term in March next year.
While the outcome of local elections does not always forecast general elections, the centre-right opposition Popular Party will try to turn Sunday's momentum into a victory at the national level.
"This is a beautiful day for our party. We've won the best result in our party's history in municipal and regional elections," Mariano Rajoy, who will be the PP candidate in the next general elections, told cheering supporters.
The PP grabbed several traditional Socialist strongholds for themselves, including the city of Seville and the Castilla-La Mancha region, both plagued with especially high unemployment.
In the aggregated municipal vote nationwide the PP had a 10-percentage point lead over the Socialists, who have not lost so badly in municipal elections since democracy returned to Spain in 1978 after the Franco dictatorship.
Spaniards had been patient during four years of economic trouble, but this wore out in the run-up to the elections when tens of thousands of mostly young protesters took to the streets in cities around the country.
EYES ON GENERAL ELECTION
The PP is expected to call for early elections, but does not have enough seats in parliament to win a vote of no confidence.
The Socialists must choose in the next few months a successor to Zapatero, who has said he will not run for a third term. Deputy Prime Minister Alfredo Perez Rubalcaba and Defence Minister Carme Chacon are both contenders.
Analysts said Zapatero wants to hang on as long as he can, giving the economy more time to pick up and boosting the Socialists' chances to win again or at least to limit PP gains.
"They're waiting for the rain to stop. If the economy improves in the third quarter and unemployment also improves, they can say it's because of their economic reforms," said Antonio Barroso, analyst with Eurasiagroup consulting firm, who sees Zapatero remaining in office until March.
EURO ZONE CRISIS
The election took place against the backdrop of the euro zone debt crisis, which forced Zapatero to make steep spending cuts to fend off concerns that Spain would follow Greece, Ireland and Portugal into budget problems and a bailout.
The austerity measures have held back economic growth and some sectors are still destroying jobs.
Zapatero promised voters that no more austerity is in the works. A fresh round could provoke renewed protests.
At the same time he promised investors that he will not budge from a commitment to cut the budget deficit to 6 percent of Gross Domestic Product this year, but some experts questioned whether he will achieve this with the economy in the doldrums.
"There's a risk of everything becoming excessively politicised which will be detrimental for the economy," said Carlos Berzosa, professor of applied economy at Madrid's Complutense university.