Stella Nyanzi, the Ugandan women’s rights activist and staunch government critic who once called head of state Yoweri Museveni “a pair of buttocks”, has received an 18-month jail sentence after she was found guilty of cyber harassment against the president.

Nyanzi, a former researcher at Makerere University, was arrested on 2 November after posting a poem on Facebook that the state deemed abusive towards Museveni and his late mother.

She was acquitted of a charge of offensive communication. Having already spent nine months behind bars, Nyanzi is expected to remain in prison for a further nine months.

The poem, posted on 16 September, the day after Museveni’s 74th birthday, suggested the president should have died at birth and accused him of corroding “all morality and professionalism out of our public institutions in Uganda”.

In Kampala on Thursday evening, magistrate Gladys Kamasanyu branded the poem “offensive and vulgar”.

“The use of obscenity cannot be justified in any society,” Kamasanyu said. “It didn’t matter who the post was referring to.”

Asked if she wanted to address the court in an attempt to reduce her sentence, Nyanzi replied: “Send me to Luzira [maximum security prison]. I am proud [of what] I told a dirty, delinquent dictator.”

She added: “I want to embolden the young people … I want them to use their voices and speak whatever words they want to speak.”

The court in Kampala was packed with activists, members of parliament, pressure groups, and leaders from different political parties.

Earlier on Thursday morning, Nyanzi had posted another poem on Facebook, declaring she “didn’t come to your court for justice”.

“I came to continue poking the leopard’s anus,” she wrote.

“Leopard” is a nickname given to Museveni after he used similar language to deal with people who attacked his supporters.

Friends took to social media to express their support for Nyanzi. Anichan Lamwaka posted: “I have failed you as a friend and it saddens me. It breaks my helpless heart that I cannot do anything to get you out of that dungeon. I love you. You fight so hard; you make me proud.”

Mwafrika Mbarikiwa Nana, a human rights defender and friend, told the Guardian that Nyanzi’s energy would not be broken.

“Each time I visited her in prison, her spirit was not broken. She was always jolly and she always smiled,” Nana said. “Her fellow prisoners love her and look up to her. Even prison warders treat her fairly. One of them confided in me that: ‘Doctor [Nyanzi] is a very OK woman’”.

Nyanzi, a mother of three, has been in prison since November. She was dismissed from her job at Makerere University in December.

“Eight months in prison is not something small. She lost her job. Not being able to be with her children is not something light,” Nana said.

Amnesty International said the verdict was “outrageous”. Joan Nyanyuk, Amnesty director for east Africa, the Horn and the Great Lakes, said the ruling “flies in the face of Uganda’s obligations to uphold the right to freedom of expression for all people in Uganda and demonstrates the depths of the government’s intolerance of criticism”.

“It must be quashed and Stella Nyanzi, who has already suffered enormously for expressing her opinions, let [go] to get on with her life,” said Nyanyuk.

She added that Uganda should scrap the Computer Misuse Act 2011, under which she was convicted, “which has been used systematically to harass, intimidate and stifle government critics like Stella Nyanzi”.

This is not the first time Nyanzi has been arrested for criticising the president.

In April 2017 she spent 33 days in the Luzira women’s prison for describing Museveni as a “pair of buttocks”. This was after Museveni had backtracked on his campaign pledge to provide free sanitary pads to all needy school girls.

She told the Guardian then: “My language will grow sharper if the government continues to oppress us.”

A trained journalist turned researcher, Nyanzi describes herself as “a lyricist, poetess, creative writer and analyst” on a quest for good governance. She has been unflinching in her criticism of the Ugandan government and is unafraid to tackle taboos around sex and gender and stand up for LGBT rights.