One of the men was held in the tourist town of Altea near Benidorm.
The other three were held in Spain’s north African enclave of Ceuta as well as Tetuan and Castillejos in northern Morocco.
Police said they had sworn loyalty to terror group ISIS and described them as “highly radicalised,” claiming they were ready if necessary to carry out terrorist attacks.
They said they were suspected of radicalising new recruits to their cause and sending them to fight in areas like Syria and Irak.
All four detainees are Moroccan.
A Spanish Ministry of Interior spokesman said in a statement: “Police in Spain and Morocco have managed to neutralise two terrorist cells and arrest their four members, all Moroccans.
“Two of them have been arrested in Spain, specifically Ceuta and Altea, and the other two in Morocco.”
The police investigation that led to their capture is understood to have been launched two years ago.
Referring to ISIS by its acronym DAESH, the Spanish government spokesman said: “The two detainees in Spain had sworn loyalty to DAESH and were in direct and constant communication with recruiters and leaders of the terrorist organisation.
“These two individuals had assumed different roles. One focused on brainwashing and radicalising potential yihadists and the other acted as an Internet-based charismatic leader, considered a sheik or spiritual leader by his disciples.”
He added: “The risk the detainees posed was due not only to their capacity in terms of radicalising recruits, but also to their willingness to head to conflict zones and become martyrs or even commit terrorist acts in their countries of origen or the countries where they were living.”
Last month five suspected ISIS terrorists have been arrested in a joint operation between police in Spain, Belgium and Germany.
Three were held in Barcelona and Spain’s north African enclave of Melilla with the other two being held in the German city of Wuppertal east of Dusseldorf and the fifth in Brussels.
A Spanish Interior Minister spokesman said at the time they formed a “perfectly organised structure” acting under the orders of ISIS whose objectives including inciting terrorism and choosing extremists they could ally to their cause.
dailystar.co.uk