Two suspects were arrested in Barcelona in northeastern Spain, one in Spain's North African territory of Melilla, one in Brussels and another in Wuppertal, in Germany, it said in a statement.
The suspects included one Moroccan national and four Spaniards.
The group used social media, mainly a Facebook page called "Islam in Spanish" - run by the suspects arrested in Belgium and Germany - to promote Islamist extremism, the statement said.
"Under the guise of disseminating religious context on this web page, radical messages were exchanged which praised jihadists, 'martyr' fighters, actions carried out by DAESH and the importance of individual jihad," it said using the Arabic acronym for Islamic State.
The Facebook page was followed by 32,500 people and was drawing 500 new followers per week, the ministry said.
The five suspects are accused of inciting attacks and acting as go-betweens for Islamic State recruitment in Europe.
"The cell which was dismantled represented a serious, concrete and continued threat to the security of Western societies," the statement said.
Spanish police have since 2015 taken part in the arrests of 143 suspected jihadists - 113 in Spain and 30 in operations carried out in other countries, the ministry said.