KAMPALA, Uganda — A prominent Ugandan academic has been sentenced to 18 months in prison after being found guilty of cyberharassment for a series of Facebook posts criticizing President Yoweri Museveni, including calling him “a pair of buttocks.”

The verdict on Friday against Stella Nyanzi, a university lecturer and researcher, drew the ire of rights activists, who accused the government of using laws about electronic communications to stifle political dissent.

Joan Nyanyuki, director for East Africa at Amnesty International, said, “This verdict is outrageous and flies in the face of Uganda’s obligations to uphold the right to freedom of expression.” She added that it “demonstrates the depths of the government’s intolerance of criticism.”

The Computer Misuse Act “has been used systematically to harass, intimidate and stifle government critics,” Ms. Nyanyuki added.