The cell found and dispatched recruits for Islamic State of Iraq and the Levant (ISIL) militants based in Syria and Iraq, Spain's interior ministry said in a statement.
"It should be highlighted that the leader of this cell lived in Spain after passing through Guantanamo, having been arrested in Afghanistan in 2001," it said, without providing further details.
Police have so far launched 12 raids, detaining eight people, and the investigation remains open, the ministry said.
Spain's government has said it fears battle-hardened Islamist fighters may return to Spain from Syria and other conflict zones under the influence of Al-Qaeda-inspired groups, presenting a threat of attacks.
The latest strike by Spanish security forces is the third significant raid on jihadist recruitment cells announced in as many months.
On May 30, security forces arrested six suspects in Melilla, one of two Spanish-governed cities along with Ceuta on the northern Morocco coast.
Spain accused the network of recruiting and sending out jihadists to join "terrorist organisations" based in Mali and Libya.
On March 14, Spanish and Moroccan forces arrested seven suspects as they broke up a cell suspected of sending volunteer fighters to Mali, Syria and
The authorities detained three people in Morocco and another four in Spain — one of whom was caught in the southern city of Malaga and the other three in Melilla.
Spain this year marked the 10th anniversary of the March 11, 2004 Al-Qaeda-inspired bombing of four packed commuter trains in Madrid, which killed 191 people.
Since the Madrid train bombings, more than 470 suspected Islamic extremists have been arrested in Spain, according to the Spanish interior ministry.