Detectives said the Moroccan styled himself on the terrorists who blew themselves up in a flat in Madrid after the 2004 train bombings in the Spanish capital which killed 192 people.
He was held in a dawn raid today in Aranjuez a short drive south of Madrid, home to a stunning royal palace and UNESCO World Heritage Site since 2001.
A spokesman for Spain’s National Police confirmed: “This operation has neutralised a dangerous lone wolf and deactivated a real threat for our country.
“The detainee demonstrated an intense fanaticism and an incessant activity on the Internet through which he taught himself to commit terrorist acts against the civilian population.”
“The investigation into the material the detainee distributed and received on the Internet shows there were multiple references to people like Osama Bin Laden and he styled himself on the four terrorists who in 2004 blew themselves up in a flat in Leganes in an incident in which a police officer died.”
A statement from the force, referring to ISIS by its acronym DAESH, said: “The detainee showed he felt no fear about the response of the forces of law and order and the courts to his actions, a symptom of his dangerousness and of his deep commitment to the terror organisation DAESH.”
Earlier this week two Moroccans and two Algerians were arrested after raids on their homes in Galicia on Spain’s north western tip and Almeria in the south east of the country.
Police said they were suspected of belonging to a people trafficking network believed to have been used by ISIS terrorists linked to the November 2015 Paris massacre.
Earlier this month four people suspected of trying to recruit ‘brainwashed’ child solders as young as 12 for ISIS, were held in Spain’s North African enclave of Ceuta.
Since the start of 2015 when Spain raised its anti-terror alert level to four on a scale of five, nearly 170 suspected jihadists have been arrested.