Moroccan journalist and human rights activist Omar Radi said Tuesday he had been handed a four-month suspended sentence for criticising a judge in a tweet.
A court in the Casablanca district of Ain Sebaa also ordered Radi to pay a fine of 500 dirhams ($52), said the journalist, who reported the verdict in a tweet as courts in Morocco are closed to the public under measures to prevent the spread of coronavirus.
"I had expected the trial to be scrapped. It is an attack on my freedom of expression," Radi told AFP, adding that he will appeal the verdict.
The ruling was immediately criticised by Amnesty International, which urged Moroccan authorities to quash the sentence.
"Even though today's verdict means Radi won't serve time in prison, he should never have been put on trial in the first place or sentenced for expressing peaceful views on social media," Amnesty's regional director Heba Morayef said in a statement.
"This sentence reinforces the message that anyone in Morocco who stands up for human rights will be punished."
In April last year, Radi criticised judge Lahcen Tolfi after he upheld sentences of up to 20 years in jail against leaders of a protest movement that rocked the country's north in 2016 and 2017.
Radi was detained briefly in December and charged with "insulting magistrates" before being released following a social media outcry over his arrest.