Stella Nyanzi, an academic and formidable campaigner, is languishing in a jail in Kampala for describing her president as “a pair of buttocks”. Uganda’s 72-year-old leader, who came to power more than 30 years ago, has become the subject of ferocious criticism for his government’s treatment of the country’s poor schoolgirls.

To Nyanzi, the announcement that her country’s government, under the leadership of President Yoweri Museveni, could not afford to supply sanitary towels to schoolgirls – despite three in every 10 missing school because of menstruation – was more than just another broken campaign promise. It was, to the academic, the epitome of abuse – a symbol of the humiliation that the east African country has endured at the hands of a political monarchy detached from the realities of those it leads. It was also the beginning of an activist journey that would land Nyanzi in a maximum-security prison for insulting the president the west once touted as a poster boy for African democracy.

It was first lady Janet Kataaha Museveni – speaking in her position as minister of education – who told parliament in February that there was no money for sanitary towels. Before her husband appointed her to her current post, Janet Museveni was the minister for Karamoja, one of the country’s poorest regions and a hub for illegal gold mining. Nyanzi, a single mother of three and medical epidemiologist who holds a PhD in sexuality and queer studies, took to Facebook to criticise the self-proclaimed Mama Janet, mother of the nation.

Fury over arrest of academic who called Uganda's president a pair of buttocks Read more

“What sort of mother allows her daughters to keep away from school because they are too poor to afford padding materials that would adequately protect them from the shame and ridicule that comes by staining their uniforms with menstrual blood?” she wrote. “What malice plays in the heart of a woman who sleeps with a man who finds money for millions of bullets, billions of bribes, and uncountable ballots to stuff into boxes but she cannot ask him to prioritise sanitary pads for poor schoolgirls?”

The post was typical of Nyanzi’s writing style on and off social media, invoking sexual innuendo and raising the ire of many in a conservative country where homosexuality is illegal and sex education banned.

Her comments provoked a storm of criticism from Museveni supporters. But amid the controversy that followed many came to Nyanzi’s defence, insisting that the Musevenis, rather than fixating on what they consider vulgarity, should address the social and political questions Nyanzi raises.

“Using the law to silence those we disagree with is intellectual cowardice, not brave leadership. If there is any merit in the arguments made by Dr Nyanzi and others like her, let us debate the substance,” wrote journalist Daniel Kalinaki in Daily Monitor, a Ugandan newspaper. Others accused the first family of being hypocritical and using the same vulgarity in criticising opponents.

“Nyanzi is an amateur when it comes to spinning catchy and dramatic lines about the nether regions. The master is her present adversary – President Museveni himself,” wrote columnist Charles Onyango Obbo.

Nyanzi’s posts often cast Janet Museveni as a modern Marie Antoinette. She ridiculed the president’s wife over an earlier statement she had made – asking parents to pack their children’s food in flasks, even though most families are unable to afford enough to eat, let alone buy food flasks. Oxfam in Uganda had just released a report showing there was growing inequality in the country and that many people could not afford necessities. Nyanzi further questioned how the first lady, who travels in SUVs, dared to tell parents, in a country whose public transport system is limping, not to transport their children on boda bodas (motorcycle taxis).

When she was first summoned to the criminal investigation directorate over her posts, which she made last month, Nyanzi’s supporters heeded her call to accompany her and bring along sanitary pads that would be delivered to the nation’s girls. It was here, in front of the CID offices, that Pads4GirlsUG, a crowdfunding campaign to raise pads for one million girls, was born.

Facebook Twitter Pinterest Stella Nyanzi in the dock at Buganda Road court in Kampala on 10 April. Photograph: Stringer/AP

“There were women and men from everywhere, bringing pads and offering to help in whatever ways they could. It was old people, it was young people. It was companies, it was anonymous donors wary of what might happen if government finds out they are supporting us,” Sheila Nyanzi, Stella’s sister and one of her lawyers, told the Observer. “They were there to support Stella and to raise money for pads.”

They hit their 1 million target within two weeks of the campaign, receiving donations within and outside Uganda, and are now aiming to acquire 10 million. The girl who tore pages out of the free books she was given at school and the girl who wrapped dry grass in a handkerchief to use while menstruating were among those who received a year’s supply of sanitary wear.

“The only way I will stop is if women stop bleeding,” Nyanzi said, laughing at the notion that she should fear for her life and for her family’s lives. “Who should not be scared in this country? We should all be scared because we might go to the hospital and find no drugs. Or we could be butchered at our doorstep any time.” Janet Museveni, stung by Nyanzi’s Facebook posts, took to national TV to declare: “Me and my family, we have served this country with dedication – with sincerity. We have made a lot of sacrifices. We are people who do not think of ourselves first.” She added that she did not understand the anger of a woman such as Nyanzi who, she said, was unfit to be an educationist because of the demonstrations she had given to schoolchildren about how to wear sanitary towels. “I still do not know what I did to deserve all those words.”

Stella Nyanzi (@drstellanyanzi) I'm collecting sanitary pads to keep poor girls in school in menstruation. Please send mobile money to 0771824117 or https://t.co/Nz63WKMB9G

“Mama Janet”, who has been accused of working with extremist US evangelical Christians to spread homophobia in Uganda, said she serves only because she was appointed by God. She declared that she forgives Nyanzi who, on her Twitter page, describes herself as “a queer laughist” and is an open supporter of LGBT rights.

Two weeks ago, days after the first lady’s TV appearance, security agents seized Nyanzi at a rally. She was held in a police cell for four days and then charged with cyber-harassment and offensive communication. Her charge sheet echoed the offence of sedition and abuse of the person of the president that was scrapped by Uganda’s constitutional court in 2010.

Perhaps to demonstrate that the first lady had nothing to do with Nyanzi’s arrest, the prosecution used a much earlier post where Nyanzi compared the president to a pair of buttocks, capable only of breaking wind and excreting. In court the state, referring to the Mental Treatment Act of 1938, argued that Nyanzi’s words were so morally decadent she should be subjected to mental examination. The court rejected the state’s request and remanded Nyanzi. She has been in a maximum-security prison, alongside terrorists and murderers, for nearly two weeks.

Amnesty International described Nyanzi’s detention as politically motivated and serving no legitimate purpose. “Public officials should tolerate more criticism than private individuals. Laws that have the intention or effect of prohibiting insulting the head of state or public officials are disproportionate, unnecessary and have a chilling effect on freedom of expression,” it said in a statement.

To the people who last week flocked to Luzira, a well-heeled Kampala suburb by the shores of Lake Victoria that also houses Uganda’s main prison, to visit Nyanzi, she is not the obscene woman whom the state accuses of being mentally unstable. She is the most formidable challenge to President Museveni’s government since the electoral tests he has faced from the opposition leader Kizza Besigye.

“It is harder to see Nyanzi [in prison] than to see Besigye,” remarked a woman who braved several checkpoints and waited six hours in the queue. She added as an afterthought: “We should push the hashtag #NyanziForPresident.”

Also waiting in the hot sun were Nyanzi’s three children – a girl aged 12 and twin nine-year-old boys. They occasionally argue over whether their mother is comparable to South Africa’s icon of freedom, Nelson Mandela. Or is she more like the unapologetic anti-colonial writer Chinua Achebe? No, she is like Wangari Maathai, the outspoken Kenyan woman whose environmental activism spelled doom for the Daniel arap Moi dictatorship that lasted 24 years.

“They understand that their mother is doing whatever is necessary for them, for her country,” said Kasha Jacqueline, an activist and friend of Nyanzi.