Morocco claims to have dismantled 160 domestic terror cells since 2002 and has been relatively untroubled by jihadists compared to other North African countries.
It believes 1,500 Moroccan nationals are fighting in Syria and Iraq, of which 220 have been jailed after returning home.
Neighbouring Libya is in the grip of a civil war which has allowed Isil to claim Sirte, the birthplace of former dictator Muammar Gaddafi, as one of its strongholds.
UN-backed Libyan forces are attempting to retake the city but have already suffered heavy losses from sniper fire and suicide bombings.
An Isil defeat in Sirte would be a serious blow to the group, which has already lost swathes of territory in Iraq and Syria in recent months.
In June 2015, dozens of British holidaymakers on the Tunisian resort of Sousse were gunned down by Isil terrorists.
Raffaello Pantucci, a security expert at the Royal Institute Services Institute, said Morocco was becoming increasingly aggressive in its bid to tackle so-called "homegrown" jihadism.
"Morocco has been very effective in preventing attacks," he told the Telegraph.
"If you go there it still feels like a safe country, there is little sense that something is bubbling under the surface.
"That is because they have been very aggressive in pursuing and arresting suspects, and that is no doubt because they are aware of the number of Moroccans who have gone to fight in Syria in Iraq.
"The Paris attackers, as we know, were Moroccan-French, and so was Mohammed Abrini, who is Belgian-Moroccan and behind the Brussels attacks," he added.
"Even the Birmingham group who provided funding for Abrini when he went to Britain have links to Morocco."
Morococ's Islamist JPD party is expected to win Friday's elections and currently leads a coalition government which rules under the authority of King Mohammed VI.
Despite this, the ultra-conservative party has been dogged by controversies including a sex scandal last August, in which two of its most devout members were found in a "sexual position" in a car parked on a beach.
Party chiefs Omar Benhammad, 63, and Fatima Nejjar, 62, are charged with adultery and attempted corruption of a policeman. They have both been suspended from the party.