Protesters urged people not to vote for ruling Socialists or the centre-right opposition Popular Party [EPA]

Hundreds of young Spaniards, angry at rising unemployment, have defied a ban on demonstrations on the eve of local elections, camping out in Madrid, the capital, and other major cities in protest.

Protesters also gathered on Saturday in Barcelona, Valencia, Seville and Bilbao, as they have been all week, urging people not to vote for either of Spain's two main parties - the ruling Socialists or the centre-right opposition Popular Party - in Sunday's elections.

At 21.3 per cent, Spain's unemployment is the highest in the 27-member European Union.

"I'm protesting because I've got no job ... in Spain even though I've finished my degree in tourism," said Inma Moreno, 25, on Madrid's Puerta del Sol plaza.

"This should make the political classes aware that something is not right."

The number of protesters, dubbed "los indignados" (the indignant), was expected to swell by the evening, after 25,000 people crammed into Madrid's main square on Friday night.

"I'm happy that they're finally protesting. It was about time," said Maria, an elderly woman with a cane, sitting next to a sleeping, dreadlocked young man on a sofa that had been moved into the Puerta del Sol plaza.

The woman, who declined to give her family name, said she was at the protest on Saturday to visit her grandson.

Fermin Bouza, a sociologist at the Complutense University, said: "We knew something like this would eventually happen. Spain's politics has not been very convincing and with all the effects of the crisis, something had to happen."

Jose Luis Rodriguez Zapatero, the prime minister, who is accused of failing to tackle unemployment, has said he understands the protesters - but voters are expected to punish his party in Sunday's vote.

The Socialists, blamed for their handling of the economic crisis, are expected to suffer major losses in the elections for 8,116 city councils and 13 of 17 regional governments.

Source: Agencies