"The detentions took place at dawn when a violent cell composed of four people, all of them members of anarchist groups, were preparing to set fire to a bank," an interior ministry statement said.
Police seized flares, firecrackers and containers filled with petrol, it added.
The statement said the plan to burn a bank was "part of a series of criminal acts in preparation" for the demonstration.
Police had a day earlier arrested three other people in possession of petrol bombs.
A movement organised online called a mass demonstration later Thursday to "Besiege Congress", the lower house of lawmakers in central Madrid, calling for the resignation of the government and a dissolution of parliament.
It was to be the latest in a string of weekly street protests fuelled by anger at Spain's recession, which has driven the unemployment rate above 27 percent according to the latest official figures released on Thursday.
Police said 1,400 officers would be deployed to prevent violence at the protest, warning they expected trouble from radical groups.
A series of demonstrations that started in May 2011 with mass gatherings of the so-called "Indignant" movement have been mostly peaceful.
Members of that movement have distanced themselves from Thursday's demonstration.