Kenya on Friday overturned a ban on Rafiki, a film about a lesbian love affair and the first ever movie from the country to be shown at the Cannes film festival.
Director Wanuri Kahiu brought the court action after the Kenya Film Classification Board banned Rafiki for "promoting lesbianism," meaning the film would be ineligible for the Oscars.
Judge Wlfrida Okwany ruled that Rafiki could now be shown to "willing adults only" for seven days, a minimum requirement for submitting feature films for the Oscars competition.
Okwany said that to maintain the ban would deprive Kahiu of "the fame, glory, exposure and opportunity that the Oscar nomination brings a film maker.
"The matter is not for determination on whether homosexuality is right or wrong, moral or immoral, but whether an artist or filmmaker can, in exercising his or her right to freedom of expression and artistic creativity, make a film depicting a gay theme."
Rafiki featured in the "Un Certain Regard" category, reserved for emerging directors or unexpected or marginal themes, at Cannes.
Kahiu now wants her film to take its chances at Academy Awards in February.
However, the award rules state that a film must "be first publicly exhibited for at least seven consecutive days in a commercial motion picture theatre for the profit of the producer and exhibitor" to enter the competition.
With the deadline of 30 September approaching Kahiu sought -- and won -- a court order in her favour.
Ezekiel Mutua, the censorship board's head and a self-described "fervent moral crusader", banned the film "due to its homosexual theme and clear intent to promote lesbianism in Kenya contrary to the law."
Kenya has retained British colonial era laws that make homosexuality illegal.
Mutua denounced Friday's ruling, asking on Twitter: "What pleasure, pray, does a person of a sane mind find in watching girls having sex with other girls?"
The film does not include sex scenes.
"Rafiki" -- meaning "friend" in Kiswahili -- is adapted from an award-winning story called "Jambula Tree" by Ugandan writer Monica Arac Nyeko.
It tells the tale of two young women from different communities who fall in love.