The suspects have been detained and will go on trial once an investigation has been completed, the interior ministry said.
"The arrested individuals planned to set up a vilayet (province) in Morocco affiliated to Daesh," it said, using an Arabic acronym for IS.
It said the arrests had foiled "terrorist plots at a very advanced stage of preparation on prisons, security establishments, festivals and leisure centres in several cities of Morocco, apart from assassinations of security officials, soldiers and tourists".
It said raids on homes had unearthed documents on the fabrication and use of explosives and firearms, as well as books inciting suicide attacks.
Rabat says 159 "terrorist cells" have been busted since 2002, including 38 over the past three years with ties to jihadists in Iraq and Syria.
A study by the US-based Soufan Group said last December that at least 1,200 Moroccans had travelled to fight alongside IS in Iraq and Syria in the previous 18 months.