Authorities carried out the arrests in several towns including Essaouira, Meknes, Sidi Kassem and al-Jadida, an interior ministry statement said, without revealing the identity of those detained.
They "might have links with jihadists fighting with Daesh", it said, using an Arabic acronym for IS, and had "received instructions to attack installations and sensitive sites" in Morocco.
They "planned to bring more extremist elements into their destructive plan... Under the supervision of experienced Daesh group leaders, one of whom is in Turkey," it said.
Morocco is on guard against deadly attacks like those claimed by IS in Tunisia last year that killed 59 foreign tourists.
Also Read
Rabat says 152 "terrorist cells" have been broken up since 2002, including 31 with ties to jihadists in Iraq and Syria since 2013.
The number of foreign fighters who travelled to Iraq and Syria to fight with IS reached at least 27,000 in the past 18 months, a study by the US-based Soufan Group said in December.
Of those, around 8,000 were from the Maghreb region, including at least 1,200 from Morocco, it said.