It said one of the suspects was arrested in the northern Moroccan port of Tangier, and the other two were detained in Spain.
The ministry said the three-man cell had been in "close contact" with IS in Iraq and Syria and was recruiting volunteers to join their ranks.
Both Morocco and Spain have been spared in the wave of recent IS attacks that have targeted Paris, Brussels and Berlin, as Rabat and Madrid collaborate closely in the fight against extremism.
However, Spain was hit in 2004 by the deadliest terrorist attack on European soil, when 191 people were killed in bombings on commuter trains in Madrid.
Islamic State developed own social media network
And Morocco was targeted in 2003 and 2011 in attacks on the cities of Casablanca and Marrakesh, with 45 and 17 fatalities respectively.
On April 28, two suspected militants were arrested in Spain that admitted being in Brussels airport at the time of the March 2016 attack there that killed 32, but denied involvement.
The two suspects were among a group of nine people taken in for questioning in Barcelona and the northeastern region of Catalonia.
At the time of the arrests in Spain, searches were carried out in Morocco by police accompanied by their Spanish counterparts.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ