Dozens detained during protests in Morocco's northern Rif region in 2016 and 2017 have been denied their right to a fair trial with some confessing under torture, Amnesty International said on Monday.
The London-based rights group said its analysis of a trial by a Casablanca court - which in June 2018 sentenced 54 people with ties to the Al-Hirak al-Shaabi protest movement to terms of one to 20 years - exposed "serious flaws".
"The first trial proceedings resulted in a gross miscarriage of justice," said Amnesty's Middle East and North Africa Director Heba Morayef in a statement, ahead of an appeal hearing set for Monday.
"The Moroccan government used these flawed legal proceedings to punish and silence prominent, peaceful social justice protesters and to intimidate others from speaking out," Morayef added.
The severity of the punishments - which were meted out to protest leaders, their followers, journalists and others - sparked anger and further protests, along with appeals for royal clemency.
The social unrest linked to Hirak began in the northern city of Al-Hoceima in October 2016 after the death of a fisherman and spiralled into a wave of protests demanding more development in the neglected Rif region.
The protesters had railed against corruption and unemployment.
Amnesty pointed to several alleged trial violations, including convictions based on "confessions" obtained by torture.
Interrogations and statements signed by defendants were in Arabic, a language many of them do not speak well, it said.
The rights group based its analysis on interviews with six lawyers for both defence and prosecution teams as well as six families of detainees.
Its evaluation also included the prosecutor's argument, the court's judgement and a range of reports.
Amnesty said the court only accepted 12 defence witnesses, refusing testimony from over 50 others.
Eleven of the 54 convicted in June received a royal pardon in August.
The cases of the remaining 43 are to be heard by the Casablanca appeal court.
Leader of the Hirak protest movement Nasser Zefzafi - who Amnesty said spent 15 months in solitary confinement - is among 39 still detained.
Another four with pending appeals have been provisionally released.