A prominent author in Kenya has come out as gay, in a country where homosexuality remains illegal.

Binyavanga Wainaina made the announcement in an article for his 43rd birthday entitled: “I am a homosexual, mum.”

“Nobody, nobody, ever in my life has heard this,” Mr Wainaina wrote in the article published first on the Africa is a Country and the Chimurenga Chronic websites.

“Never, mum. I did not trust you, mum. And. I. Pulled air hard and balled it down into my navel, and let it out slow and firm, clean and without bumps out of my mouth, loud and clear over a shoulder, into her ear. ‘I am a homosexual, mum,'” he wrote.

Mr Wainaina’s article was styled as a “lost chapter” from his 2011 memoir One Day I Will Write About This Place.

“Of course my friends knew, but I had been toying with how useful it would be to make a public statement for close to eight months,” he told the GlobalPost news website on Monday.

He won the 2002 Caine Prize for African Writing for his short story, Discovering Home.

The move is a brave decision. Mr Wainaina has also strongly criticised Nigeria’s anti-gay law, saying it “shames us all”.

His decision has drawn mixed reaction among Kenyans on social media.

Some people have praised him for being courageous while others have warned that he could face a backlash

Consensual sexual activity between men is illegal under Kenyan law and carries a maximum penalty of 14 years’ imprisonment.