MADRID — Thousands of protesters in Madrid furious over soaring unemployment staged a silent protest and then erupted in cheers of joy as a 48-hour ban on their demonstration took effect on Saturday.

“Now we are all illegal” and “the people united will never be defeated,” were among the chants of the protesters who crammed Madrid’s Puerta del Sol square and spilled onto side streets.

The protesters held a minute’s silence, their hands in the air and some with tape over their mouths, just before midnight on Friday, when campaigning officially ended for Sunday’s regional and municipal elections.

The crowd then cheered as the clock in the square, the main site of New Year festivities in Madrid, chimed midnight and a ban on the protest became effective.

“From Tahrir to Madrid to the world, world revolution,” said one of the placards, referring to Tahrir Square in Cairo which was the focal point of the Egyptian revolution earlier this year.

Some 19,000 people took part, according to a calculation by the Lynce organisation which estimates crowd numbers and released by the Spanish national news agency Efe.

Thousands of people have massed in city centres across the country in an swelling movement that began May 15, the biggest spontaneous protests since the property bubble exploded in 2008 and plunged Spain into a recession from which it only emerged this year.

Spain’s electoral commission late on Thursday declared that protests planned for Saturday and for Sunday are illegal as they “go beyond the constitutionally guaranteed right to demonstrate.”

Saturday is by law “a day of reflection” ahead of the local elections, meaning political activity is barred.

But organisers of the spearhead protest in Madrid vowed to defy the ban.

Interior Minister Alfredo Perez Rubalcaba said Friday that police “will enforce the law” against the protesters but “in a proportional manner.”

But Spain’s leading daily El Pais quoted government sources as saying police will only intervene if there is violence.

“The fact that the gatherings are banned in not enough reason for the police to act” against the demonstrators, the centre-left paper said on its website.

Calling for “Real Democracy Now,” the protests, popularly known as M-15, were called to condemn Spain’s soaring unemployment, economic crisis, politicians in general, and corruption.

Spain’s Prime Minister Jose Luis Rodriguez Zapatero, whose Socialist Party is facing a crushing defeat in Sunday’s polls, on Friday voiced sympathy for the protesters, saying they were reacting to unemployment and the economic crisis “in a peaceful manner.”

Spain’s jobless rate hit 21.19 percent in the first quarter of this year, the highest in the industrialised world. For under-25s, the jobless rate in February was 44.6 percent.

“My obligation is to listen, be sensitive, try to give an answer from the government so that we can recover the economy and employment as soon as possible,” Zapatero told radio Cadena Ser.

Even before the protests, polls forecast devastating losses for the Socialists as voters take revenge for the destruction of millions of jobs and painful spending cuts, including to state salaries.

More than 34 million people are eligible to vote Sunday, choosing 8,116 mayors, 68,400 town councillors and 824 members of regional parliaments for 13 of the 17 semi-autonomous regions.

Polls in El Pais and El Mundo predicted the Socialists would lose control of strongholds such as Barcelona, Seville and the Castilla-La Mancha region.