El Mortada Iamrachen, a 31-year-old member of a protest movement in Morocco’s neglected northern Rif region, was convicted in November of “defending terrorism” and incitement.
A court is expected to hear his appeal on Wednesday.
New York-based HRW said Iamrachen’s conviction was based on a “possibly coerced confession”.
“Once again, a Moroccan activist is thrown in prison after his contested confession is used to convict him,” said the group’s Middle East and North Africa director Sarah Leah Whitson.
“This may well not be a terrorism case at all, but rather a twisted effort to punish yet another leader of a protest movement that the Moroccan government seems determined to crush.”
HRW said Iamrachen was accused of praising and inciting acts of terrorism in Facebook posts about news including the assassination of Russia’s ambassador in Turkey in December 2016.
In another post, the activist wrote of telling a journalist that Al-Qaeda leader Ayman al-Zawahiri had ordered him to import weapons into the Rif region, but he said in court that the post was sarcastic, according to HRW.
The court rejected his claim that his confession had been coerced by police who threatened to publish private pictures of his wife that were found on his laptop, the rights group said.
Iamrachen was a member of the Al-Hirak al-Shaabi, or “Popular Movement”, a group calling for jobs and an end to graft in the Rif region.
More than 400 people have been detained since May, including the protest movement’s leader, and dozens sentenced to prison over the unrest.
Download our app and read this and other great stories on the move. Available for Android and iOS.