Spanish and Moroccan security forces dismantled a six-member terror cell and arrested five suspected extremists in Morocco and one in Melilla, a Spanish enclave in northern Africa, the Spanish interior ministry said Wednesday.

According to a ministry statement, the leader of the cell, a Spanish national of Moroccan origin, was among the arrested.

"The investigation conducted by the National Police and the Moroccan DGST Service found that the group held its meetings at night behind closed doors where they planned major terror attacks," the ministry statement said. "In addition, investigators detected physical training sessions that went so far as to simulate assassinations by decapitation," it added.

The detainees formed a "dangerous" terror cell, as Moroccan police pointed out they had planned large-scale attacks and held meetings where they simulated beheadings.

The cell leader, a 39-year-old suspect whose name was not disclosed, took advantage of his job as an educational assistant at a juvenile rehabilitation and rejuvenation center to carry out recruitment and indoctrination activities.

The ministry highlighted the importance of this joint operation and the exceptional collaboration between authorities from both countries, which enabled the neutralization of a dangerous threat with potential consequences in both Spain and Morocco.

Since Spain raised its terror threat level to four _ from a scale up to five _ security forces have detained at least 199 suspected extremists.

This operation came weeks after the attacks on Barcelona and Cambrils, in northeastern Catalonia, where 16 people were killed and more than 100 others were wounded.