By Fiona Ortiz
MADRID (Reuters) - Spain's centre-right opposition Popular Party took the lead in Sunday's local elections that were expected to inflict heavy losses on the ruling Socialists after a week of protests over high unemployment.
With 47 percent of votes counted, the PP had 36 percent of votes while the Socialists had 28 percent. The rest was divided among an array of smaller parties.
Tens of thousands of angry Spaniards demonstrated in cities around Spain all week, urging voters to reject the two main political parties.
On Saturday night their numbers peaked, with around 30,000 people in Madrid's Puerta del Sol alone, witnesses said. Analysts said the protests would have only a marginal impact on the voting as opinion polls already showed Socialist defeats.
"I've voted for the PP because the Socialists are doing a very bad job ... It's true there's been a worldwide crisis, but Zapatero didn't react to it on time," said Jesus Lopez, a retired man voting in the Arguelles neighborhood of Madrid.
Spaniards were electing more than 8,000 city councils and 13 out of the country's 17 regional legislatures.
Prime Minister Jose Luis Rodriguez Zapatero, applauded abroad for his fiscal discipline during the euro zone crisis, has become unpopular at home as the economy stagnates.
Almost half of Spaniards aged 18-25 are out of work, more than double the European Union average.
The Socialists are expected to lose bellwether regions such as Castilla-La Mancha, just south of Madrid, where they have controlled the regional legislature for decades, and the city of Seville, where they have been in power for 12 years.
The Socialists, in national office since 2004, also look likely to lose the next general election, which is scheduled for March 2012 but could be moved up if big losses on Sunday spark a leadership crisis within the party.
(Additional reporting by Jesus Aguado)