A YouTube star from Morocco was sentenced to four years in prison on Thursday for "insulting the king" during a live video stream, according to his lawyer.

Mohamed Sekkaki, who goes by "Moul Kaskita" on YouTube, was sentenced in the city of Settat, about 100 miles south of the country’s capital, Rabat, Mohamed Ziane told AFP.

Sekkaki, whose channel has nearly 350,000 subscribers, was arrested earlier this month after posting a video during which he allegedly called his fellow Moroccans “donkeys” and criticized King Mohammed VI, according to AFP.

Per Morocco’s criminal code, “insulting magistrates” carries a prison term of between one month and one year.

Ziane says he plans to appeal the decision on behalf of his client.

MOROCCAN KING PARDONS JOURNALIST IMPRISONED FOR EXTRAMARITAL SEX, ABORTION, AFTER OUTCRY

Sekkaki’s case comes after other similarly harsh measures against activists and journalists who have spoken out against the government.

A 33-year-old journalist, Omar Radi, is currently being prosecuted for a 9-month-old tweet that criticized a judge, AFP reported.

CLICK HERE TO GET THE FOX NEWS APP

In July, the Moroccan Human Rights Association deplored what it regarded as an “escalation of violations of human rights and public and individual freedoms.”