Jihadist groups in the nearby Sahel region, which recruit and train their followers online, represent Morocco's biggest militant threat, the head of its counterterrorism agency said.
Although Morocco has had only one major attack over the past decade - the 2018 killing of two Scandinavian tourists - its location "makes it a target for the Sahel groups" said Haboub Cherkaoui.
"The terrorist threat persists as long as there are groups that recruit and train their followers online including Islamic State in the greater Sahara," he told Reuters in an interview.
Since it was set up in 2015, Cherkaoui's Central Bureau of Judicial Investigation has dismantled dozens of militant cells and arrested more than a thousand suspected jihadists, he said.
The numbers point to the continued militant risk in Morocco after the rise of Islamic State in Syria and Iraq last decade caused a surge in jihadist activity that persists even after the group was defeated in its Middle East heartland.