The High Court on Friday temporarily lifted the ban imposed by the Kenya Film Classification Board (KFCB) on Rafiki film to allow it be considered for an award at the Oscars.
The film was banned for promoting lesbianism but Justice Wilfred Okwany lifted it for seven days, during which she has allowed it to be screened to willing adults.
In making the ruling, Justice Okwany cited Kenyan artists who've had to flee the country and to seek asylum because their creations went against the grain of societal expectations.
Ms Wanuri Kahiu had sued KFCB and its boss Ezekiel Mutua over the ban since it was to be submitted to the 2019 Oscars Award as Kenya's entry to the Best Foreign Language film category.
Rafiki is a love story of two teenage girls who develop a romantic relationship, which is opposed by their families and community.
In the film, directed, written and co-produced by Ms Kahiu, the girls are separated by their communities.
The film was adapted from the short story Jambula Tree by Uganda's Monica Arac de Nyeko, which was awarded the prestigious Caine Prize for African Writing in 2007.
According to Ms Kahiu and the lobby, the ban on the film is contrary to the freedom of artistic creativity.