MADRID - Spanish police detained 24 people during street violence late on Saturday following a large anti-austerity demonstration in Madrid in which dozens were injured, a police spokesman said.

Tens of thousands of people, some having walked from the farthest corners of Spain, marched though the streets of Madrid on Saturday to demonstrate against spending cuts, sky-high unemployment and alleged corruption.

The peaceful march took a violent turn in the late evening while most protesters dispersed as dozens of youths smashed the windows of several banks, set rubbish bins on fire and threw rocks at police. Police responded by firing rubber bullets and charging to disperse the protesters.

Twenty-four people were arrested, including three under the age of 18, a police spokesman said Sunday.

Emergency services said 101 people were hurt — 67 police and 34 protesters. None of the injuries were serious, they said.

Eight columns of protesters had converged on the Spanish capital Saturday — carrying flags from Andalucia in the south, Catalonia in the east, or the Asturias in the northwest — at the culmination of nearly a month of walking for some of the protesters.

The “march for dignity” comes after two years of bruising austerity measures imposed by Spain’s conservative government as part of a bid to close one of the highest public deficits in the eurozone.

Prime Minister Mariano Rajoy, in power since December 2011, has imposed harsh spending cuts and tax rises aimed at saving 150 billion euros ($207 billion) between 2012 and 2014.

Austerity has left Spain in a prolonged economic funk, with more than 26 percent of the population — and half of under-25s — out of work.