A Uganda prison officer has been sacked for criticising the government on TikTok, in a rare move authorities said amounted to gross indiscipline.

Lawrence Ampe had been under investigation over social media posts accusing senior government officials of corruption, human rights abuses and mistreatment of lower-ranking prison officers.

The standing orders don't allow a public officer to participate in politics, which he is doing even now, prisons spokesman Frank Baine told the BBC, saying Ampe was sacked for politicking in the wrong forum.

The opposition has condemned the move, describing it as evidence of systemic oppression and double standards within the security sector.

The officer shared the dismissal letter on his TikTok account with the caption: I'm finally out free to support truth.

In another video, Ampe urged Ugandans not to worry about how he would survive without a job, saying: What we are doing is not all about money but about liberating our nation.

He said he was using his TikTok account, which has more than 100,000 followers, to expose senior government officials who are involved in corruption and misusing their power, and to tell Ugandans how to love their country.

The officer has also used his social media accounts to promote election campaign videos for opposition leader Bobi Wine, a pop star-turned-politician, whose real name is Robert Kyagulanyi Ssentamu. Bobi Wine is seeking to unseat President Yoweri Museveni in the 15 January elections, as the long-serving leader aims to extend his nearly 40-year rule.

In a statement, the Prisons Council said it had resolved to dismiss Ampe and ordered him to hand over all state property in his possession.

The BBC has reached out to Ampe for comment.

Last month, the Uganda Prisons Service said it was investigating Ampe for his self-made TikTok videos on various subjects, cautioning officers against using social media to express political opinions.

Despite the warning, Ampe reportedly continued uploading political videos, leading to further disciplinary proceedings. Rights groups also regularly denounce the Ugandan authorities over violations of human rights and the freedom of expression.

The government has previously been accused of restricting people's ability to criticise the actions of the state or its officials. The US government in a 2023 report said Uganda had restricted internet freedom through the use of criminal punishments.

Ultimately, the combination of Ampe's dismissal and the broader repression of dissent highlights ongoing challenges surrounding free speech and political dissent in Uganda.