This operation was carried out jointly with Morocco's General Directorate of Territorial Surveillance (DGST) and the Spanish National Intelligence Center (CNI), said the Spanish Police in a statement.
The man is accused of participation in recruiting people to join ISIS through social media networks.
During the operation, which took place last Thursday, a search of the home of the suspect led to the seizure of several electronic equipment and documents which are being analyzed by the competent services.
His activities on the Internet revealed that he was a follower of ISIS and he was involved in spreading documents glorifying jihad.