Spain's National Police and Morocco's domestic intelligence service (DGST) have arrested five Moroccans and one Spaniard on terrorism charges, the Spanish Home Office said in a statement on Wednesday morning.
Five individuals were arrested in Morocco and one in the Spanish North African city of Melilla.
One of the men holds Spanish nationality, four are Moroccan and the sixth is a Moroccan resident in Spain.
The cell's leader was resident in Melilla and "taking advantage of his job as a teaching assistant in a youth re-education centre to recruit and radicalise especially vulnerable young people".
The Home Office said his work had been "effective" and that the cell he had built up was "ready to turn to violent Jihad with a dangerous level of activation".
The group held secret night-time meetings "to plan large terrorist attacks", physical training sessions and simulated beheadings.
A "dangerous threat" had been "neutralised" and the Home Office described bilateral cooperation with Morocco as "excellent".