Morocco has proposed a law which would criminalise joining armed groups or undergoing training in conflict zones in a move that targets up to 2,000 Moroccans believed to be fighting in Syria and Iraq.
The new bill incriminates joining or trying to join armed groups and training camps "in hotbeds of tension", a government statement said late on Thursday, the Reuters news agency reported.
It also allows the government to pursue Moroccans, and foreigners in Morocco, who are suspected of involvement in "terrorist crimes outside the kingdom".
The legislation, which will be put before parliament's two houses in October, aims to stop the flow of Moroccans fighting with armed groups in places like Syria, Iraq and, in previous years, Mali.
Most Moroccans joining terrorist organisations are poor, unemployed and live in tough neighbourhoods. That is where the fight against terrorism should start, not in killing freedom of speech.
Those found guilty of receiving training will face five to 15 years in prison and fines of between $5,800 and $58,000, the AP news agency reported.
Moroccans are estimated to be second only to Tunisians among North Africans in the ranks of the Islamic State of Iraq and the Levant (ISIL).
Between 1,200 and 2,000 of them are estimated to have joined the group that has taken over large swathes of Iraq and Syria.
The kingdom, which has had its share of violence in the past, fears that its nationals who have joined Syria's civil war and the conflict in Iraq will pose a security challenge when they return home.
Authorities say they have already dismantled dozens of recruitment networks aimed at sending Moroccans abroad to fight, or plotting to carry out attacks on Moroccan soil.
The proposed bill also criminalises acts seen as justifying or supporting violence, an element that rights activists see as a threat to freedom of speech.
They say the government uses "terrorism" charges to jail opponents and journalists.
A Moroccan editor is facing terrorism charges after posting a link to an al-Qaeda video threatening the Moroccan king on his website, although he was released on bail last year.
Moroccan journalists run the risk of imprisonment for criticising the monarchy, Islam and the conflict over the
disputed territory of Western Sahara, while television stations are entirely controlled by the government.
"We don't really need those amendments to get things worse. All anti-terrorism law should be repealed as we have enough laws in the Moroccan Penal Code to counter terrorism", Abdelilah Benabdeslam of the Moroccan Association of Human rights said.
"Most Moroccans joining terrorist organisations are poor, unemployed and live in tough neighbourhoods. That is where the fight against terrorism should start, not in killing freedom of speech", he added.