A former Guantanamo Bay detainee was among eight men arrested for allegedly recruiting militants to fight for the Islamic State of Iraq and Syria, or ISIS, the Sunni militant group battling government forces in Iraq. It was unclear if the recruits were in Iraq, but Spain’s interior ministry said they were sent to the Middle East.

“The main leader of this [recruitment] cell lived in Spain after having spent time at the [U.S. detention center] in Guantanamo, having been arrested in Afghanistan in 2001,” the ministry said in a statement Monday, according to Reuters. His name was not released.

A dozen buildings in Madrid were going to be searched in connection with the arrests, the ministry said.

ISIS has hurled Iraq into chaos after attacking government troops in an attempt to carve out a caliphate in Syria and Iraq based on Sunni Muslim ideals. The group has seized large swaths of northern and north-central Iraq, and by Sunday, the fighting got closer to Baghdad, prompting the U.S. to decide to evacuate 5,300 employees from its embassy in the capital.

Spain has, in the past, arrested militants who recruited fighters on the Spanish mainland and the country’s territories of Ceuta and Melilla in northern Africa, to be sent to Syria and other areas.