MADRID (Reuters) - Two Moroccan men suspected of having links to Islamic State have been arrested in Spain and police say one of them played an important role in spreading propaganda for the militant group, the Interior Ministry said on Wednesday.

The man - described as a “dangerous solitary actor” living in the outskirts of the capital Madrid - had been radicalised through Internet websites aimed at encouraging individuals to attack civil populations, the ministry said.

Investigators found he had closely followed websites dedicated to Islamist militant suicide attacks and Islamic State activity over a long period of time and had used a number of different online profiles, it said in a statement.

The man was a “key element” of Islamic State’s decentralized propaganda machine to recruit others to join the group, it said.

The second man, arrested in an operation in the city of Irun close to the French border, had tried to join Islamic State fighters by going to Turkey where he was captured by police and sent back to Spain, where he was arrested, the ministry said.

Spanish police have arrested 170 suspected Islamist militants since the security alert level was raised to one notch below the highest in 2015 following terrorist attacks in Paris.