According to the Europa Press news agency, the magazines were of the type used for assault rifles such as the AK-47, but a police spokeswoman was unable to confirm this when contacted by AFP.
The interior ministry said the two men were Spanish and had been detained for "glorifying terrorism," without giving any further details.
The arrests come as Spain strengthens security during the holiday season.
Authorities in Madrid are taking unprecedented measures for New Year's Eve, when thousands gather in the central Puerta del Sol square for traditional celebrations that see Spaniards swallow a grape for each of the 12 strokes of midnight.
All those entering the square will be searched.
Bollards will be used on nearby roads alongside police vans to guard against truck attacks like those that hit Nice in France in July, and Berlin on December 19th.
Barcelona has taken similar measures.
According to Spanish authorities, 177 alleged jihadists have been detained since 2015, when Spain increased its terror alert to category four on a five-point scale.
Spain has been mentioned on extremist websites as a possible attack target for historical reasons, given much of its territory was under Muslim rule from 711 to 1492.
But unlike France or Belgium, the country is less exposed to the risk of return of radicalised nationals who went to fight abroad and plan to commit extremist acts on home soil.
Only around 200 Spaniards are estimated to have gone abroad to fight, compared to thousands from nearby France and Belgium.
Still, the interior ministry announced Wednesday that the Spanish wives of two Islamic State group fighters "responsible for dozens of murders" had been arrested in Turkey with their young children, attempting to return to Europe.
The ministry said both women left the Spanish territory of Ceuta in northern Africa in 2014 with their husbands, and went to Syria "where they had since been part of the terrorist organisation."
A ministry source, who refused to be named, said one of the women was married to Mohamed Hamdouch, known as "Kokito," who according to Spanish media would pose with the heads of victims he had decapitated and died last year.