Civil Guard officers arrested two Moroccans in the town of Pinto and one Moroccan and a Spaniard in the town of Ciempozuelos, south of the Spanish capital.
#ÚLTIMAHORA La @guardiacivil detiene en Pinto y Ciempozuelos (Madrid) a 4 personas acusadas de adoctrinamiento y captación yihadista
— Ministerio Interior (@interiorgob) May 3, 2016
The statement said that the four formed part of an organized group responsible for spreading extremist material on the Internet.
READ MORE: Who are Spain's jihadists?
It said the group made contact with hundreds of people through social media, chat rooms and via messaging apps and then selected some to be radicalized and indoctrinated.
The men will be taken before an investigating magistrate.
It is the latest in a series of arrests of suspected jihadists in Spain including an Isis recruiter held in Mallorca earlier this month who is thought to have been planning an attacks in Spain.