It was the latest in a series of protests by mainly young people against Spain's politicians focussing on their response to the economic crisis.
Shouting "Gallardon thief," and "We won't pay for this crisis," they blocked streets around the city hall, kept at a distance by helmeted riot police.
Scuffles broke out when the police cleared a passage for official cars leaving the city hall. Tinted windows firmly closed, the vehicles were greeted with shouts of "Thieves out" and "Shame" as they drove through a wall of policemen.
A huge banner read "Gallardon Does Not Represent Us."
The group known as "the indignant", who began an occupation of Madrid's Puerta del Sol square in mid-May, called for Saturday's demonstration "to congratulate the mayor on his hijacking of our future."
Gallardon's right-wing Popular Party retained control of Madrid in municipal elections on May 22 which saw a rout for the country's governing Socialists.
Protests over the economic crisis began in Madrid on May 15 and fanned out to city squares nationwide as word spread by Twitter and Facebook among demonstrators also known as "M-15", "Spanish Revolution" and "Real Democracy Now."
The Spanish economy slumped into recession during the second half of 2008 as the global financial meltdown compounded the collapse of the once-booming property market. It emerged with meagre growth in early 2010.
The crisis sent the unemployment rate soaring to 21 percent in the first quarter of 2011, the highest in the industrialised world. Among young people it is even higher.
Short link: