Nine people were arrested in a Spanish enclave in northern Africa and in Morocco on suspicion of being involved in a terror cell with ties to ISIS, the militant group now known as the Islamic State group. Spain and Morocco said Friday that the cell, which was recruiting jihadists for ISIS, was dismantled.

The leader of the cell was a Spaniard and the brother of a former Spanish soldier who now fights with the Islamic State, Spain’s Interior Ministry told the Associated Press. The eight other alleged militants who were arrested were Moroccan. The crackdown occurred in Melilla, a Spanish-administered enclave in northern Africa and in the Moroccan border town of Nador. The cell members were trained in explosives and firearms.

The leader traveled to Mali in western Africa and other places where jihadists are fighting to recruit members for the cell, the New York Times reported, citing Spanish media. He stole and trafficked cars to raise funds for the Islamic State, according to the AP.

The Moroccan government said the cell also had connections to al Qaeda in the Islamic Maghreb, the terror organization’s branch in Mali, the AP reported. The nine arrests were the second joint Spanish-Moroccan operation since Aug. 14, when another cell was broken up in Ceuta, another Spanish enclave in northern Africa. Melilla and Ceuta have been hotbeds for terrorist recruiting.