“Rafiki” –- meaning “friend” in Kiswahili –- is adapted from a prize-winning short story called “Jambula Tree” by Ugandan writer Monica Arac de Nyeko.

The film, telling the tale of two young women whose fathers are political rivals, is the first-ever film from Kenya to get a slot at the world’s most prestigious cinema festival. It premieres on Wednesday in the “Un Certain Regard” category, reserved for emerging directors or unexpected or marginal themes.

The ban was announced by Ezekiel Mutua, a self-described “fervent moral crusader” who runs the Kenya Film Classification Board and has described his job as “upholding our cultural and moral values through content regulation.”

He railed against the film for seeking to “normalise homosexuality in Kenya” and condemned it for showing “the resilience of the youngsters involved in lesbianism.”

He demanded that director Wanuri Kahiu cut the “offensive classifiable elements”, including “romantic scenes” and “a happy ending”.

Kahiu has declined to speak much about the Kenyan ban, focusing instead on the premiere.

But she wrote on Twitter that she was “incredibly sorry” about the ban. “Adult Kenyans are mature and discerning enough to watch local content but their right has been denied,” she said.

– ‘International ridicule’ –

What might have been a moment of celebration of a breakthrough success by a local filmmaker has instead won Kenya “international ridicule,” said columnist Makau Mutua in this weekend’s Standard newspaper.

“Methinks Mutua should go back to his homophobic Neanderthal’s cave,” wrote Mutua (“thankfully not my relative,” he clarified).

Mutua, the censor, he wrote, “is among a cabal of homophobic state officials who haven’t read the 2010 Constitution.”

That constitution, voted for by referendum, has become the basis of legal challenges to homophobia in Kenya, spearheaded by the National Gay and Lesbian Human Rights Commission (NGLHRC).

The group’s current court battle is its most important: using the freedoms enshrined in Kenya’s modern constitution to combat the bigotry contained in its colonial-era penal code.

“Clauses 162 and 165 talk about unnatural acts against the order of nature… (and) are used to target, specifically, sexual and gender minorities in Kenya. Our court case is a constitutional challenge to the legality of these laws,” said Waruguru Gaitho, a lawyer at the rights group.

Judges heard evidence in February and March, after a two-year delay, but are yet to give a date for their ruling. Until then, the threat of a 14-year jail term hangs over lesbian, gay, bisexual and transgender (LGBT) Kenyans picked up by police or informed on by neighbours.

The irony is that the religious beliefs in which Kenyan homophobia is rooted — and the laws that justify it — are both Western imports. Yet anti-gay groups claim, without apparent irony, that homosexuality is a liberal Western imposition contrary to “traditional” values.

“Homophobia is western, homosexuality is not,” countered Gaitho.

Kevin Mwachiro, author of the story collection “Invisible” about gay life in Kenya, said the situation for sexual minorities was improving, but contradictory.

“The fact we have a government that doesn’t have any new legislation to target LGBTI individuals, that is a plus, yet within that same government there’s a body that is banning movies made by Kenyans, about Kenyans, for Kenyans? That for me is the story of Kenya.”

“There is a lot of movement that is happening, some level of acceptance that is taking place,” he said.

– Progress? –

Activists say the picture for gay rights in Africa is often bleak but most visibly so in the east of the continent, where Burundi, Rwanda, Tanzania and Uganda also have a long record of repression and stigma.

In Kenya, high-profile gays have helped to lead the campaign for change. Celebrated writer Binyavanga Wainaina, who dramatically came out in 2014, last week announced his engagement.

“I asked my love for his hand in marriage two weeks ago. He said yes, nearly immediately,” Wainaina wrote on Facebook. But he said the couple would be wed and live in South Africa — the only African country where gay marriage is permitted and one of few free of state-backed discrimination against homosexuals.

Wainaina’s declaration -– like the banning of “Rafiki” -– split the country’s commentariat and social media chatterers, trolls and gadflies. It earned praise from liberals and rights activists, and condemnation from conservatives and Christians.

Despite such progress, anti-gay sentiment remains dominant, and led from the top.

Last month President Uhuru Kenyatta repeated the anti-gay lobby’s “culture” argument in an interview with broadcaster CNN.

“This is not an issue… of human rights. This is an issue of society. Of our own base as a culture, as a people,” Kenyatta said.

Gaitho was dismayed.

“It casts a negative light as to where Kenya is at in its struggle for equality,” she said. And with the independence of the judiciary still in question, “There’s always the worry that statements made by powerful leaders might have a negative impact on cases like ours.”

Nevertheless, Gaitho said the situation was changing, if gradually.

“It’s not that all Kenyans are starting to be progressive and accepting,” she said. “But there’s a realisation that fundamental human rights belong to everyone.”