Three people were arrested in Spain's North African enclave city of Ceuta while a Moroccan was arrested in the Moroccan border town of Farkhana, next to Melilla, Spain's other North African enclave, statements from the two nations' interior ministries said.
One of those detained in Ceuta was the former Guantanamo detainee who was not named by Spanish authorities but described as "a leader who was trained in handling weapons, explosives and in military tactics." After being captured in 2002 and held in Guantanamo, he was returned to Spain in 2004, said Interior Minister Jorge Fernandez Diaz.
The suspects had set up contacts to try to acquire weapons and bomb-making materials and were aiming "to carry out terrorist acts in Spanish territory," the Spanish ministry statement said, without specifying possible targets.
They also worked to recruit teenagers from Ceuta to join IS in Iraq and Syria, the Spanish statement said.
Spanish police arrested about 100 suspected Islamic extremists last year and more than 600 total since the 2004 train bombings in Madrid that killed 191 people and injured nearly 2,000.