Open this photo in gallery Wanuri Kahiu, the director of the film Rafiki, is pictured in Nairobi, Kenya on April 27, 2018. Ben Curtis/The Associated Press

An African film renaissance is filling cinemas and winning praise from Hollywood to Cannes with powerful movies that explore cultural and social taboos. But at home, some of the most acclaimed films are suffering a different fate: censorship, protests, death threats and official bans.

Film censors in Kenya have launched the latest clampdown. A movie called Rafiki, which has made history by becoming the first Kenyan film to be invited to the Cannes Film Festival, will be banned at home for “attempting to normalize homosexual practices,” the national film classification board announced on Friday.

Rafiki, which means “friend” in Swahili, is based on an award-winning short story by a Ugandan writer. It tells the story of two women, from families divided by political rivalry, who become close friends and then lovers, in defiance of their conservative society. The film will have its world premiere at the prestigious Un Certain Regard series at Cannes next month.

Story continues below advertisement

It is the second African film to be banned this year. Inxeba (The Wound), an acclaimed South African film that was shortlisted for an Academy Award in the foreign language category, was banned in February by South Africa’s film appeals tribunal. The tribunal complained that the film’s scenes of gay sex had no “artistic value” and could “increase tensions in society.”

Inxeba is a portrait of the relationship between two men who meet during a traditional initiation rite in the remote mountains of the Eastern Cape, a largely rural province. The film’s release triggered protests by traditional leaders in the province. Threats against the filmmakers led to the cancellation of some screenings.

Open this photo in gallery Rafiki tells the story of two women, from families divided by political rivalry, who become close friends and then lovers.

The filmmakers challenged the ban in court. Their supporters said the ban was homophobic and a violation of constitutional freedoms. Three weeks later, the ban was lifted and the film returned to cinemas, becoming the most popular South African movie of the year so far.

South Africa’s constitution, one of the most progressive in the world, prohibits discrimination on the grounds of sexual orientation, and gay marriage is legal. But anti-gay prejudice and violence are still common.

The situation is much worse in dozens of African countries, including Kenya, where homosexuality has been criminalized under laws that date back to the colonial era. Gay sex can lead to a prison sentence of up to 14 years.

The Kenya Film Classification Board, announcing the ban on Rafiki on Friday, said the film had a “clear intent to promote lesbianism” and was “contrary to the law and dominant values of the Kenyans.”

Open this photo in gallery 'We believe adult Kenyans are mature and discerning enough to watch local content, but their right has been denied,' Wanuri Kahiu tweeted on Friday. Ben Curtis/The Associated Press

Just 10 days ago, the board’s chief executive officer, Ezekiel Mutua, had praised the film as “a story about the realities of our time.” He said its director, Wanuri Kahiu, was “our icon.”

Story continues below advertisement

But on Friday he was suddenly scornful of the film, saying only “perverts and social deviants” would see it. He complained of “hare-brained schemes” by foreign film financiers to “promote homosexuality” in Kenya.

Ms. Kahiu said she was “incredibly sorry” to learn of the ban. “We believe adult Kenyans are mature and discerning enough to watch local content, but their right has been denied,” she tweeted on Friday.

Speaking later in an interview with Radio France Internationale, she said the film board had asked her to change the ending because it was “too hopeful.” She rejected the demand, she said, because she believes in “hopeful and joyous” stories about Africa.

Open this photo in gallery Rafiki will have its world premiere at the prestigious Un Certain Regard series at Cannes next month.

“I feel incredibly disappointed because I truly believe that the Kenyan audience is not only cosmopolitan, it is intelligent, it’s mature, it’s discerning,” Ms. Kahiu said.

“I believe it is our right as creators to reflect society and it is our role to talk about all subjects. We have a freedom of expression clause in our constitution and we should not be discriminated against.”

The Kenyan film board has a long history of banning movies, including the Hollywood films The Wolf of Wall Street in 2014 and Fifty Shades of Grey in 2015. It banned several U.S. children’s shows last year because they were allegedly “glorifying” homosexuality. It even banned a kissing scene in a Coca-Cola commercial.

Story continues below advertisement

Gay-rights activists, meanwhile, have launched a landmark case to challenge Kenya’s criminalization of homosexuality. After months of arguments, they are awaiting judgment from a lower court. The case is expected to be fought all the way to the Supreme Court.