The arrests took place in several cities on December 8 as part of "ongoing efforts to fight terrorist dangers", the source said.
Some of the suspects have already been referred to the judiciary, the source added.
Moroccan news outlets had reported a nationwide counter-terror operation on December 8, but official sources had not confirmed the crackdown.
Reports on Saturday said that during the operations, the authorities seized weapons including firearms and ammunition, as well as documents on bomb-making and material glorifying ISIS.
They said investigations revealed the suspects were planning to carry out attacks inside Morocco.
On Friday, counter-terrorism police said that they had thwarted a suspected ISIS bomb plot and arrested an alleged supporter of the group, in co-operation with US intelligence services.
The security source told AFP the operation had no connection to the arrests earlier this month.
On October 6, counter-terrorism police announced the dismantling of a terrorist cell in the northern city of Tangiers and the arrest of five suspects accused of plotting bomb attacks.
Since 2002, Moroccan police say they have dismantled 2,000 terror cells and arrested 3,500 people in cases linked to extremism, according to figures published in February.