A Kenyan judge has temporarily suspended the ban on Rafiki, a locally produced film about a lesbian romance, following a court challenge by the film's director.

The boss of Kenya's film regulator, the KFCB, had banned it in April last year because of its same-sex theme.

Ezekiel Mutua said it promoted lesbianism, which he said was against Kenya's culture.

The film's director Wanuri Kahiu went to court to argue that the ban by KFCB made it impossible for her to submit the film for review for the 2019 Oscars Awards.

A journalist - who was at the High Court in the capital, Nairobi - tweeted that the film is allowed to be screened for seven days.

In another tweet she quoted presiding judge Wilfrida Okwany as saying that the film would not compromise Kenyans morality.

Set in Nairobi, Rafiki tells the coming-of-age story of two young women, Kena and Ziki, who meet and fall in love.

Their romance unfolds against a backdrop of homophobia and intolerance in a country where gay sex is outlawed.

It was screened at this year's Cannes Film Festival.