Emergency services said 29 people were injured when unrest broke out at the demonstration near the parliament in central Madrid by protesters calling for the government and lawmakers to quit.
The demonstration coincided with the release of Spain's latest official unemployment figures which showed the jobless rate had surged past 27 percent, with 6.2 million people out of work.
Around 1,000 protesters massed in front of a police barrier protecting the lower house of parliament, yelling: "They don't represent us" and "We are not afraid".
Some held signs reading "6.2 million reasons".
A group of protesters hurled bottles at the police line and let off firecrackers, prompting riot cops with shields and helmets to chase them along nearby avenues, beating some with batons.
Police told AFP they detained 15 people, including a minor who had a firecracker, acid and stones in his rucksack and instructions for making petrol bombs on his mobile phone.
The ambulance service said 29 people suffered minor injuries including 13 police.
Police also said ahead of the demonstration that they had arrested four members of anarchist groups suspected of plotting to set fire to a bank and 11 people who blocked access to a university.
It was the latest in two years of mass protests in Spanish cities that have swelled under the conservative government that took office in December 2011.
As well as overseeing a bailout for Spain's banking sector, Prime Minister Mariano Rajoy has brought in spending cuts and labour reforms.
He says the steps are needed to fix the public finances and strengthen the economy and will help Spain save €150 billion ($196 billion) by 2014.
Protesters say the cuts are causing unfair suffering to the poor and complain that the political system is stacked against them.
"We are protesting to try and win back the democracy that has been stolen from us," said one demonstrator, Manuel 31, who would not give his second name.
"The money that the government should be giving to help people get jobs has instead been given to ruined banks, while it is the people who need help."
A movement organized online had urged protesters to "Besiege Congress", the lower house of lawmakers in central Madrid.
Police deployed 1,400 officers at the demonstration, saying they expected trouble from radical groups.
A series of demonstrations that started in May 2011 with mass gatherings of the so-called "Indignants" movement have been mostly peaceful.
Members of the "Indignants" distanced themselves from Thursday's demonstration.
Rising unemployment in Spain has caused evictions to soar and forced tens of thousands of people to leave in search of work abroad.
The number of households in which all eligible members are unemployed reached 1.91 million in the first quarter, the statistics office said.
Rajoy's government was due on Friday to unveil a further package of economic reforms.