One of Africa’s best-known authors and gay rights activists, Binyavanga Wainaina, has died at the age of 48.

The Kenyan author died on Tuesday night in Nairobi after a short illness, the BBC reported. His death was confirmed by Tom Maliti, the chairman of the Kwani Trust, which Wainaina founded.

Wainaina, who won the 2002 Caine prize for African writing, made headlines around the world in 2014, when he responded to a wave of recent anti-gay laws around the continent by publicly outing himself in a short essay, published to mark his 43rd birthday. He also revealed he was HIV positive.

Calling it the “lost chapter” of his 2011 memoir One Day I Will Write About This Place, the essay I Am a Homosexual, Mum reimagined the last days of his mother’s life, in which he went to her deathbed and told her the truth about his sexuality.

“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,” he wrote.

“All people have dignity. There’s nobody who was born without a soul and a spirit,” he said, in an interview with the Associated Press in 2014. “There is nobody who is a beast or an animal, right? Everyone, we homosexuals, are people and we need our oxygen to breathe.”

Wainaina was also known for his biting essay How to Write About Africa, which included the advice: “Always use the word ‘Africa’ or ‘Darkness’ or ‘Safari’ in your title.

“Never have a picture of a well-adjusted African on the cover of your book, or in it, unless that African has won the Nobel prize. An AK-47, prominent ribs, naked breasts: use these. If you must include an African, make sure you get one in Masai or Zulu or Dogon dress,” he wrote, signing off: “Always end your book with Nelson Mandela saying something about rainbows or renaissances. Because you care.”

Ellah Wakatama Allfrey, Wainaina’s friend, and chair of the Caine prize, said the author was “unbound in his imagining – reminding us, with art and characteristic playfulness, what English can look like when it’s an African language”.

“Unflagging in his generosity, unflinching and direct in his criticism, he produced work in his short life that will have impact longer-lasting than those whose time here is twice as long. On a deeply personal level, and as one who acknowledges the wings he gave to a generation of writers, I am bereft,” said Allfrey.

Sigrid Rausing at Granta said the magazine had published nothing so widely read or influential as How to Write About Africa, which she said “started as a letter to the editor, protesting about Granta’s 1994 issue on Africa, which, he wrote, was ‘populated by every literary bogeyman that any African has ever known’” – a claim, she acknowledged, which was probably right.

“He could have become a poster boy for liberal literary Africa, a ‘cultural personality’, but he resisted turning himself into anything other than what he was: a writer, and an editor,” Rausing said. “And yet he had a profound influence, through Kwani?, his literary magazine, through his refusal to accept the othering of Africa and Africans, through coming out in a homophobic society and through advocating for feminist principles, for the idea of ‘upright Africans’.”

Rausing also praised his “stubborn spirit, the refusal to give in”, as well as his warmth, directness, and intelligence. “He saw through things, and came out the other side.”

After Wainaina came out, Time magazine in 2014 named him one of its 100 most influential people, with Nigerian author Chimamanda Ngozi Adichie praising him for having “demystified and humanised homosexuality” after the death of a Kenyan friend, whose family were prevented from holding a church memorial: “He felt an obligation to chip away at the shame that made people like his friend die in silence.”

Last year, Wainaina announced his engagement on Facebook. “I asked my love for his hand in marriage two weeks ago. He said yes, nearly immediately,” he wrote. “Nothing has surprised me more than coming to love this person, who is gentle and has the most gorgeous heart.”

Wainaina’s death comes just days before a long-awaited court ruling in Kenya this Friday on whether to abolish laws that criminalise homosexual activity. The Kenyan laws, as in many other African countries that outlaw same-sex relations, are vestiges of British colonial rule.

Associated Press contributed to this report.