The suspect was linked with a French Isis cell that had planned to attack Paris on Thursday but was broken up by French authorities in November, the Moroccan interior ministry said.
The suspect had met Isis operatives on the Syrian-Turkish border and received instructions to be delivered to the cell in France, it charged.
The orders came from the jihadist group in territory it controls in Syria and Iraq.
French security services broke up the cell by arresting seven men in Strasbourg and Marseille on November 19 and 20, according to the French interior ministry.
The public prosecutor for Paris later said the men had been in contact with a commander in Iraq or Syria.
A year ago, Moroccan intelligence helped put French investigators on the trail of Abdelhamid Abaaoud, a 28-year-old Belgian of Moroccan origin who had appeared in grisly IS videos and was linked to a series of plots in Europe.
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.
Morocco has also arrested eight men with alleged ties to IS active in the cities of Fez and Tangiers, the interior ministry said on Friday.