Updated: The man who rammed a car loaded with gas bottles into the headquarters of Spain's ruling Popular Party in Madrid on Friday morning has said any party could have been the target of the attack as "all politicians are the same".

The man, identified as 37-year-old Daniel Pérez Berlanga by Spanish media, was arrested after the incident which took place at around 7.15am with a spokesperson for Spanish national police saying he would undergo psychiatric evaluation.

"My intention was to attack all politicians because they are all the same," the man from the tiny town of Bronchales in Teruel province told police after his arrest.

"Although I attacked the PP it could have been any other party," he said.

Pérez Berlanga who has a previous criminal conviction for robbery and is currently being treated for drug abuse and schizophrenia spent several days planning Friday's attack, Spanish newspaper El País reported.

He blamed the government for his current poor financial situation, the daily added.

Made redundant in May, he has been receiving unemployment benefits since that time and has been living with his mother and father, who is an ex-mayor of his hometown with Spain's Socialist party.

Police cordoned off the area around the PP headquarters in Madrid's Calle Génova on Friday morning after Pérez Berlanga rammed his car into the political headquarters. Initial fears were of a terrorist attack.

The man's Citroën Xantia was carrying two gas bottles and a substance Pérez Berlanga said was an explosive, according to Spain's Cadena SER radio station.

He claimed he was carrying 15 kilograms of the explosive ammonal — a mixture of ammonium nitrate and aluminium powder — and three timers, the Spanish edition of the Huffington Post reported.

However, initial analysis showed that while a substance found in the car was flammable, it wasn't an explosive.

Nobody was hurt in the attack.

Madrid’s former PP president, Esperanza Aguirre, talking to radio station esRadio, said the car had broken through the glass front of the building and reached the staircase which leads to the first floor.

"One of the cleaners who was inside the building was extremely close to being run over because the car was being driven at an incredible speed."

Aguirre confirmed that the cleaner was not hurt but had suffered "a horrific scare".

The deputy leader of the party, Maria Dolores Cospedal, said that "the possibility of a terrorist attack has been ruled out".

"We wish to send a message of calm and thank the police for their quick and efficient response," she said in a statement.

The party's parliamentary spokesman Rafael Hernando said: "It obviously causes great alarm that someone could attack a political party — mine or any other."

Since coming to power in 2011, Prime Minister Mariano Rajoy and his Popular Party have imposed tough economic cuts that they say were needed to drag Spain out of an economic crisis.

Rajoy says Spain is now recovering, but the unemployment rate remains extremely high at 23.67 percent.