Thousands of anti-austerity protesters who marched to Spain's parliament were prevented from surrounding the building by metal rail barricades and a large police presence.
The Surround Parliament group had called on people to gather at Plaza de Espana and march on the legislature to oppose spending cuts and tax rises introduced by Prime Minister Mariano Rajoy's government.
Police on horseback and with dogs had on Saturday arrived at Neptuno fountain next to parliament in preparation for crowd control duties as the protesters marched 2.3 kilometres from the muster point.
Protesters were joined by a strong police escort, including vans with reinforced windows.
Earlier, about 3,000 off-duty police officers had also demonstrated against the government's austerity measures, including the cancellation of their Christmas bonuses.
Since being elected in November, Rajoy has increased taxes, cut spending - including a wage-cut for civil servants - and introduced stinging labour reforms to persuade investors and international authorities that he can manage Spain's finances without a full-blown bailout.
However, Spain's public finances have been overwhelmed by the cost of rescuing some of its banks and regional governments, many of which have experienced heavy losses following a property sector crash in 2008.
One Spaniard in four is unemployed and the government is under pressure to seek aid to ease debts, as the country sinks into its second recession in three years.
Economic output has contracted for five quarters in a row and Spain's banks have been granted a US$130 billion loan by the 17 euro-zone countries.