The interior ministry said in a statement that the suspect, arrested on Friday in the port city of Al-Muhammadiyah near Casablanca and Rabat, had "direct links with some" of the Paris attackers.
The statement said the man had travelled to Syria along with one of the suicide bombers who blew himself up in the northern Paris district of Saint-Denis near the Stade de France national stadium.
While in Syria the suspect, who was not named, initially joined Al-Qaeda's Syria affiliate, Al-Nusra Front, before linking up with the Islamic State group, which claimed the Paris attacks.
During his stay in Syria he took military training and made connections with IS commanders, including "the mastermind of the terrorist attacks in the French capital," the statement said.
Signup to our newsletter and follow us on Facebook and Twitter!
The suspect had entered Morocco via The Netherlands, after travelling from Syria through Turkey, Germany and Belgium, the statement said.
Prosecutors in France have identified the alleged planner of the November Paris attack as Belgian national Abdelhamid Abaaoud, who was killed in a shootout with police days after the onslaught.
Moroccan intelligence helped put French investigators on the trail of Abaaoud.
One of the gunmen in the attacks was last week identified by French authorities as Belgian-Moroccan man Chakib Akrouh, with Brussels prosecutors saying he had travelled to Syria in 2013 to join IS.
The series of coordinated shootings and bombings in Paris killed 130 people, the bloodiest attacks in Europe since the Madrid train bombings in 2004.