A Spanish court has ordered pretrial detention without bail for a man who rammed a car containing homemade explosives and gas cylinders into the ruling Popular Party's headquarters.

A Madrid court said late Saturday that 37-year-old Daniel Perez will be held while he is investigated in connection with alleged offences of possession of explosives, wreaking havoc and causing damage at the headquarters.

No one was injured, but Perez's vehicle contained two inflammable gas cylinders and a rudimentary explosive device made with fertilizer and fuel, Madrid police chief Alfonso Fernandez said.

Perez allegedly drove from the town of Bronchales, 250 kilometers (155 miles) east of Madrid, to ram into the reception area of the headquarters Friday. Bronchales' mayor says the man was unemployed.