The 41-year-old extremist tried to “build expertise in the use of arms”, Morocco’s central office for judicial investigations said in a statement.
He was imbued in the “ideological propaganda” of the Islamic State group, it added.
“Electronic devices and documents… on the making of explosives” were seized, the office said.
Long spared jihadist violence, Morocco was last year hit by the gruesome murder of two Scandinavian tourists in the High Atlas mountains, committed in the name of IS.
The perpetrators were sentenced to death, a penalty not carried out in Morocco since 1993.