A Moroccan computer engineer has been sentenced to three years in jail for setting up a Facebook profile in the name of a member of the royal family.
Mr Mourtada said his fake Facebook profile was just a bit of fun
Fouad Mourtada was arrested on 5 February on suspicion of stealing the identity of Prince Moulay Rachid, younger brother of King Mohammed VI.
The Casablanca court also ordered Mr Mourtada, 26, to pay a $1,300 fine.
The prosecution had urged the court to impose a sentence which set an example for others.
Mr Mourtada was convicted of "villainous practices linked to the alleged theft of the [prince's] identity".
In his defence, he said he admired the prince, and that the Facebook entry was just intended to be a bit of fun.
A website supporting him published a letter addressed to the prince apologising for the incident.
The letter, reportedly penned by Mr Mourtada's family, requested clemency.
"Fouad Mourtada, like thousands of people who create fake profiles of well-known personalities or celebrities on Facebook, has in no way acted in a willingness to cause nuisance to Your Highness, for whom he has always shown the greatest of respect," the letter on the Help Fouad website reads.
Earlier this week some Moroccan bloggers went "on strike", suspending their regular blog entries for 24 hours in protest at Mr Mourtada's detention.
According to the website, he told family members who visited him in jail that he had been blindfolded and beaten unconscious at the time of his arrest.