When she first aroused the government's ire with her Facebook taunts, Stella Nyanzi says she was merely tickling the leopard.

The leopard is President Yoweri Museveni, who has ruled Uganda for 31 years. And Ms. Nyanzi is the fearless heckler who has tormented the powerful beast.

It's a typically vivid image from the exuberant Ugandan scholar and feminist, who speaks in a rich stew of metaphor, profanity, rude insults and bawdy humour – in several languages. It has made her a star on Facebook, where thousands of Ugandans are obsessed with her earthy language and bold criticism of the regime.

Story continues below advertisement

Last month, one of those metaphors landed her in prison. In an audacious assault, Ms. Nyanzi denounced the President as a "pair of buttocks" who does "what buttocks do." She was arrested and imprisoned for five weeks on charges of "offensive" communication and "disturbing the peace" of the President.

Even after her release on bail, Ugandan prosecutors continue to demand that she be subjected to a psychiatric evaluation under the terms of a rarely used colonial-era law. Their implication – that she must be insane for criticizing their ruler – is reminiscent of the Soviet Union's widespread practice of sending dissidents to psychiatric hospitals.

Ms. Nyanzi's story is a cocktail of issues that provoke controversy here: human rights, freedom of expression, feminism, cultural taboos and the rise of social media. But at the heart of it all is her imaginative use of language and her fierce defiance of the perceived limits for Ugandan women.

In her first media interview since her prison ordeal, she told The Globe and Mail how she challenged the traditional Ugandan notion of women's roles.

"Uganda was colonized and Christianized by the British," she said, laughing. "We were brought up to be good girls, to be decent, to be polite, to speak nicely to authority. Women here are not to be heard, they shut up, they don't speak, they're to be seen as beautiful."

Some observers have described her style as "radical rudeness." But it has won strong support from Uganda's literary community. In a petition in her defence, 68 Ugandan writers said they were shocked that Ms. Nyanzi would face criminal charges for "her deployment of a metaphor."

They warned that the criminalization of language could have a chilling effect on writers. If the use of literary devices can lead to criminal prosecution, they said, it would mean that "we are unable to express ourselves creatively, to contribute to our country's literary and cultural wealth."

Story continues below advertisement

Ms. Nyanzi, an anthropologist and research fellow at Makerere University in Kampala, erupted in gales of laughter as she described how her words are replaced by bleeps on radio and television reports. But the truth, she said, is that language is her "soft ammunition" in a non-violent struggle.

"What other avenues do we have left to us?" she asked. "We don't have guns or money. But I can still write and think and insult and abuse."

Her provocative use of language is linked to the equally provocative cause that she champions: the lack of sanitary pads for Ugandan schoolgirls, who often stay home for several days a month during menstruation because they are too poor to afford pads. It is a major cause of the high dropout rate for Ugandan girls. In an election campaign last year, Mr. Museveni promised to finance a national program of sanitary pads for schoolgirls. But after the election, he abandoned the promise, saying the government couldn't afford it.

Ms. Nyanzi responded with a ferocious critique on social media of the President and his wife, Janet Museveni, who is also the Education Minister. And then she launched her own campaign to collect money and donations to buy thousands of pads.

Her popularity on social media is a potential threat to the regime because she can reach the young generation of voters in a country where the vast majority of the population is under 30. And her skill at exposing Mr. Museveni's broken promises may have deeply embarrassed the government, triggering her arrest. But she is unrepentant. "Screw the government," she said. "The government should be embarrassed, every day."

She is scornful of those who told her to remove her "dangerous" Facebook posts. "You cowards," she scoffed.

Story continues below advertisement

When her university tried to padlock her office on the pretext that she had failed to keep up her teaching duties, she launched an unorthodox protest: She stripped down to her underwear on campus until her office was returned to her. "I will protect myself with my nudity," she told journalists at the protest.

Ugandans are divided in their views on Ms. Nyanzi. Many support her because she is outspoken on subjects that others are too fearful to touch. "She is telling the truth," said Jamie, a taxi driver in Kampala who said it would be too risky to give his surname. "She will wake up the people."

But others dislike her profanity and sexual metaphors. Her advocacy for gay rights is equally controversial in a country where homosexuality is illegal. One local newspaper described her as "vulgar," while an MP accused her of "unbecoming" behaviour.

Nicholas Opiyo, a human-rights lawyer who has helped defend her in court, witnessed this discomfort among Ugandans when he tried to find people to guarantee Ms. Nyanzi's bail application. He had to approach 47 people before he found two who were willing to do so.

Even many women's groups were reluctant to serve as her guarantor. "I'm good with her, but I can't stand her language," they told her lawyers.

Ugandan journalist Barbara Among said women in Uganda are expected to be "gentle and quiet" and discuss sex and menstruation only in private with a mother or aunt. "Stella uses taboo language to talk publicly about a taboo subject, and that creates a double jeopardy for her."

Story continues below advertisement

In fact, Mr. Museveni himself has sometimes used the same kind of colourful language she uses. In 2015, he warned his enemies that they would be "touching the anus of a leopard" (playing with fire) if they tangled with him.

Ms. Nyanzi's lawyers plan to use this phrase as evidence in court. If the President is allowed to use an off-colour metaphor, they will argue, then her language should be equally tolerated.

Throughout the legal battles, Ms. Nyanzi has seen her fame grow. She is now a national figure in Uganda with a larger-than-life image.

"A perfect, bold, strong Stella was created," she said. "It's a huge person, and I refuse to fit in her shoes. That's not me. I'm just a woman living her life."