A Ugandan court has sentenced a 24-year-old man to six years in prison for insulting the president and the first family through his video posted on TikTok.

Edward Awebwa was charged with hate speech and spreading “misleading and malicious” information against President Yoweri Museveni, First Lady Janet Museveni and son Muhoozi Kainerugaba, who is the head of the military.

The court also heard that Awebwa had shared abusive information – saying there would be an increase in taxes under President Museveni.

He had pleaded guilty and asked for forgiveness.

The presiding magistrate said that while he had pleaded for mercy, he did not look remorseful for his actions, and the words used in the video were “really vulgar”.

“The accused deserves a punishment which will enable him learn from his past so that next time he will respect the person of the president, the first lady and the first son,” magistrate Stella Maris Amabilis said.

He was sentenced to six years for each of the four charges against him, which are to run concurrently.

Rights groups regularly denounce Ugandan authorities for violations of human rights and freedom of expression.

In 2022, award-winning Ugandan author Kakwenza Rukirabashaija was charged with two counts of “offensive communication” after making unflattering remarks about the president and his son on Twitter.

He fled the country to Germany after spending a month in jail, where he claimed he had been tortured.

Activist and writer Stella Nyanzi, who is also in exile, had earlier been jailed after publishing a poem that was critical against Mr Museveni.

President Museveni has been in power since 1986 – 14 years before Awebwa was born.

In 2022 he signed into law a against speech which rights groups criticised, saying it was aimed at suppressing freedom of speech online.

Last year, the constitutional court ruled that a section of the act that penalised “offensive communication” was unconstitutional.

Ugandan human rights lawyer Michael Aboneka said Awebwa had been charged under the same broader law that they are still challenging in court because “it is vague”.

He told the BBC Newsday programme that the president and his family should expect to be criticised “at whatever angle”.

“Unless they are saying that they are going to arrest every Ugandan for criticising them at every point,” he said.