A Tunisian rapper was handed a two-year jail sentence on Thursday for insulting the police in a song, with the court ruling sparking clashes between his supporters and police.
Ala Yaacoub, 25, better known by his rap name "Weld El 15", was retried at the same court in a Tunis suburb that had convicted him in absentia in March, after he handed himself him in to face justice.
As the judge read out the verdict, shouts of protest erupted in the courtroom from his supporters who were swiftly expelled by police.
Several people were beaten outside the building, including Emine M'tiraoui, a journalist with the news blog Nawaat, and at least three people arrested.
There was evidence of tear gas outside the court house, but it was not clear who had fired it, with the police and friends of the singer blaming each other.
"The sentence is very tough for an artist who decided of his own accord to face justice," said Yaacoub's lawyer Ghazi Mrabet.
"It is particularly unfair that no text exists for suppressing a work of art."
Yaacoub, who had been in hiding, was given a two-year jail sentence in March after posting a rap video called "The Police are Dogs" on the Internet.
He later turned himself in and was hoping for a more lenient sentence.
The lawyer said he faced half a dozen charges, including conspiracy to commit violence against public officials and insulting the police.
Sitting in a cafe with friends before the trial opened on Thursday, Yaacoub had said he was afraid and criticised the authorities for not respecting freedom of speech.
"I am afraid because in a country like Tunisia the law is not applied; you can expect anything," he told AFP.
"In the song, I used the same terms that the police used to speak about the youth. The police have to respect citizens if they want to be respected," Yaacoub added.
In the video the singer is heard saying: "Police, magistrates, I'm here to tell you one thing, you dogs; I'll kill police instead of sheep; Give me a gun I'll shoot them."
Ahead of the trial in March, in which four others were handed prison sentences but later released, the interior ministry said the song's lyrics were "unethical, abusive and threatening" towards pubic officials.
Members of the Tunisian opposition were quick to condemn Thursday's court ruling, comparing it to the two-year suspended jail sentences given to 20 Islamists involved in an attack on the US embassy last year, which have been strongly criticised as excessively lenient.
"Weld 15 got two years and there were suspended sentences for the attack on the US embassy, I feel bad for our youth at this critical time," MP Karima Souid wrote on Twitter.
The secular opposition frequently accuses the government led by Islamist party Ennahda of manipulating the judiciary to muzzle free speech and of seeking to impose Islamic values on Tunisian society.
Several cases relating to the freedom of expression have sparked outrage in the North African country since Ennahda's rise to power after the January 2011 revolution.
On Wednesday, three European members of the radical women's protest group Femen were jailed for four months for staging a topless demonstration in Tunis in support of a detained Tunisian activist.
The judge found them guilty of public indecency, but their supporters say they were performing a legitimate protest and that women's rights were under attack. Amnesty has called for their release, saying "imprisoning people for expression is inherently disproportionate."
In April 2012, two youths were sentenced to seven and a half years for publishing caricatures of the Prophet Mohammed on Facebook. One of them managed to escape and was granted political asylum in France.