Waving thousands of red, gold and purple republican flags, the crowd chanted: "Tomorrow, Spain will be republican".
"Nobody elected the king," said protester Veronica Ruiz. "We want a referendum. It would be the fair and democratic way to find out what the people want."
The protest was called to mark the anniversary of the country's Second Republic, proclaimed on April 14th 1931, and followed by 40 years of dictatorship under General Francisco Franco after a 1936-39 civil war.
King Juan Carlos is credited with steering Spain to a parliamentary democracy under a constitutional monarchy following Franco's death in 1975.
But family scandals have undercut public confidence in the monarchy during a bruising recession.
A year ago as unemployment hit a record 26 percent, the country was stunned as it emerged the King had gone elephant hunting in Botswana and broke his leg during the costly excursion.
The 75-year-old monarch was forced to apologize to the nation.
The King's youngest daughter Princess Cristina has also been named a suspect in a corruption case against her husband Inaki Urdangarin, accused of siphoning off millions of euros paid by regional governments to a non-profit organization he chaired from 2004 to 2006.
Support for the monarchy in Spain has fallen to a historic low of 54 percent, according to a poll published in the daily El Mundo in January.
"Considering the current situation in Spain, what we need is a republic, and to put an end to the plundering by the Bourbons," said 20-year-old student Anabel Galiano, referring to the Spanish royal house.