TUNIS, Tunisia—The defense lawyer for a Tunisian rapper says his client has been convicted of insulting police and sentenced to four months in prison.

Ghazi Mrabet said rapper Ala Yacoubi, known as Weld El 15, appeared in court in the coastal city of Hammamet Thursday on charges of insulting a public servant and public morals for performing his song "Police are Dogs" at a concert in August.

He was originally sentenced to 21 months in prison in absentia and has since been in hiding.

The trial was the latest in a string of suits against musicians on similar charges in a country that overthrew its president in 2011 and is trying to set down democratic norms.

The music scene, especially rap, has flourished since the overthrow of Zine El Abidine Ben Ali, but they have run into resistance from authorities.