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.
The statement said that the four formed part of an organized group responsible for spreading extremist material on the Internet.
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.