Nyanzi was arrested late on Friday, more than two months after the offending posts were published and charged with “cyber harassment”. She pleaded not guilty on Monday but was denied bail and has been detained in a maximum security prison ever since.

Has Yoweri Museveni walked the talk on funding family planning in Uganda? | Richard M Kavuma

Read more

Nyanzi, a mother of three, has repeatedly criticised both Museveni, who has ruled since 1986, and the first lady. She has taken aim at the government’s failure to fulfil its commitment to provide sanitary pads to all schoolgirls, which was a campaign promise before the 2016 elections.

After the education ministry said the promise could not be fulfilled for economic reasons, Nyanzi launched the #Pads4girlsUg campaign and a crowdfunding page to raise money to buy and distribute them herself. It was after a fundraiser for this cause on 7 April that she was arrested.

“Lack of sanitary towels is one of the leading causes of girls dropping out of school in Uganda,” said Muthoni Wanyeki, Amnesty International’s regional director for east Africa, the Horn and the Great Lakes. “Dr Nyanzi has led a campaign to ensure girls continue to attend school with dignity during their periods and, instead of commending her, the authorities have harassed, intimidated and now arrested her.”

Wanyeki called for the charges to be dropped and said Nyzanzi should be granted an unconditional release, adding: “Arresting Nyanzi simply for criticising the president and his wife serves no legitimate purpose.”

The Facebook post over which Nyanzi was charged read: “That is what buttocks do. They shake, jiggle, shit and fart. Museveni is just another pair of buttocks … Ugandans should be shocked that we allowed these buttocks to continue leading our country.”

Nyanzi was also charged with using the internet to “disturb the peace, quiet or right to privacy” of Museveni.

Stella Nyanzi has rounded on Yoweri Museveni for failing to make good on his election promise to provide sanitary pads for schoolgirls. Photograph: Edward Echwalu/Reuters

Her response to the charges, delivered before a packed courtroom in the capital, Kampala, was posted on Facebook by prominent LGBT activist Kasha Jacqueline Nabagesera, who is supporting Nyanzi.

According to the post, Nyanzi told the judge: “Offensive communication? Who is offended? How long are Ugandans going to be silent because of fear … I am an academic, poet. A writer. I use my writing metaphorically. I have called the president impotent, a rapist, a pathetic pair of buttocks. He lied to voters that he would provide pads and Ugandans are offended that he is such a dishonourable man. It is we who are offended, not him.”

Nyanzi is expected back in court on 25 April. Prosecutors want her to undergo a psychiatric examination, which her lawyers indicated they would resist. In Uganda such examinations are usually reserved for suspects accused of crimes such as statutory rape.

Nyanzi’s lawyers have taken the case to the high court and protested to the authorities about her treatment. One of them, Nicholas Opiyo, who is also director of Chapter Four Uganda, a civil liberties NGO, said: “We are hopeful as we think people are beginning to understand just how vindictive the whole court process has been to Stella, and how unlawful it has been and how in the process several of her rights have been violated.”

Opiyo said of the contested psychiatric examination: “They just want to declare her an idiot so they delegitimise a legitimate form of expression, and send her away to a mental health hospital.”

Maria Burnett, associate director of the Africa division of Human Rights Watch, said Nyzani’s case was yet another case of freedom of expression being violated in Uganda. “What’s most troubling here is that she has lost her liberty when all government officials should expect to face criticism in their roles as leaders.”

Burnett also expressed concern about the way the arrest happened. “She was abducted by plain clothes police very late on a Friday night … We looked for her all night and couldn’t find where she had been taken.

“This was a very punitive way of carrying out an arrest, especially as she said the remarks weeks before, so she could been arrested in the daytime, been interrogated and released for bail on the same day.

“There is no doubt that the way in which she was arrested was about seeking to intimidate and terrify her and her family and her community of supporters who are largely drawn from Uganda’s human rights, women’s and LGBTI movements.”

Burnett predicts the charges will be dropped, adding that the arrest is the president’s way of sending a message. “This is a revenge tactic where the first family is using its state agencies to ensure someone who has been a critic is punished. Whether she is actually punished in a court of law, she is being punished right now by being denied bail and kept away from her three small children over Easter.”

Nyanzi, who specialises in the study of sexuality in Africa, shot to prominence last year when she stripped naked at her university to protest the closure of her office.

The detention has led to the hashtag #FreeStellaNyanzi, which is trending in Uganda and other African countries.