WASHINGTON — Binyavanga Wainaina, a prize-winning Kenyan writer whose humorous, incisive books and essays explored themes of postcolonialism, gender, and sexual identity, including his own decision to come out as a gay man in a country that long demonized homosexuality, died May 21 in Nairobi. He was 48.
Tom Maliti, the chairman of Mr. Wainaina’s literary organization, the Kwani Trust, confirmed the death to the Associated Press but did not give a precise cause. Kenya’s Daily Nation newspaper reported that Mr. Wainaina had died at a hospital after a stroke, one of several he had suffered since announcing in 2016 that he was living with HIV.
Easily recognizable by his short-cropped, rainbow-dyed hair, Mr. Wainaina was considered one of the finest African writers of his generation and a pivotal figure in Kenya’s modern literary history.
He received the 2002 Caine Prize for African Writing for his short story ‘‘Discovering Home,’’ a semiautobiographical tale of a young man returning to Kenya from South Africa. The next year, he founded the English-language literary magazine Kwani? (Swahili for So?), which spurred a wave of artistic creativity just as Kenya’s autocratic president, Daniel arap Moi, left office after 24 years in power.
‘‘Binyavanga was unbound in his imagining — reminding us with art and characteristic playfulness what English can look like when it’s an African language,’’ Ellah Wakatama Allfrey, a Zimbabwe-born editor and literary critic, said in a tribute after Mr. Wainaina’s death.
As an editor and writer for publications in Africa and abroad, including Vanity Fair and the New York Times, Mr. Wainaina spent much of his career working to dismantle stereotypes against gay Africans and the continent as a whole. He acquired international renown with his 2005 essay ‘‘How to Write About Africa,’’ a satirical response to more than a century of overgeneralized, condescending works about the ‘‘dark continent.’’
‘‘Always use the word ‘Africa’ or ‘Darkness’ or ‘Safari’ in your title,’’ he began, before advising Western writers to ‘‘treat Africa as if it were one country,’’ ‘‘make sure you show how Africans have music and rhythm deep in their souls,’’ and avoid mentioning ‘‘school-going children who are not suffering from yaws or Ebola fever or female genital mutilation.’’
‘‘Africa is the only continent you can love — take advantage of this,’’ he added. ‘‘If you are a man, thrust yourself into her warm virgin forests. If you are a woman, treat Africa as a man who wears a bush jacket and disappears off into the sunset. Africa is to be pitied, worshiped or dominated. Whichever angle you take, be sure to leave the strong impression that without your intervention and your important book, Africa is doomed.’’
The essay was originally published in the British literary magazine Granta, which said that Mr. Wainaina’s article was one of its most popular pieces. ‘‘As a student, he sent the magazine a strongly worded letter condemning our 1994 Africa issue,’’ Granta tweeted Wednesday. ‘‘His ironic critique was so incisive and true that we published it.’’
Mr. Wainaina drew glowing reviews for his 2011 memoir, ‘‘One Day I Will Write About This Place,’’ and three years later released what he described as ‘‘a lost chapter’’ from the book, ‘‘I Am a Homosexual, Mum.’’
With its release online, the essay became a ‘‘gay bombshell’’ in Kenya, the Daily Nation wrote, and made Mr. Wainaina one of the most prominent openly gay men in Africa.
The story imagined his coming out to his mother on her deathbed — because of visa issues, he was unable to fly from South Africa to reach her in time — and his decades-long struggle to embrace his sexuality.
He had known he was gay since he was 5, he said, but did not act on his feelings until five years after his mother’s death, when he received ‘‘a massage and some brief, paid-for love’’ in London.
‘‘I cannot say the word gay until I am 39, four years after that brief massage encounter,’’ he wrote.
Mr. Wainaina said the article was inspired in part by increasing penalties against gays in Africa. Homosexual activity remains outlawed in Kenya, and the country’s High Court is expected to rule on the law’s constitutionality on Friday.
Three months after he published the essay, Mr. Wainaina was named to Time magazine’s list of ‘‘The 100 Most Influential People.’’
‘‘He felt an obligation to chip away at the shame’’ surrounding homosexuality, Nigerian author Chimamanda Ngozi Adichie wrote in Time.
‘‘By publicly and courageously declaring that he is a gay African, Binyavanga has demystified and humanized homosexuality and begun a necessary conversation that can no longer be about the ‘faceless other.’”
‘‘He told us that in the new Kenya, you can talk about real issues,’’ writer Alvas Onguru told The Washington Post in 2003, referring to Kwani?.
Kenneth Binyavanga Wainaina was born in Nakuru, in Kenya’s Great Rift Valley, on Jan. 18, 1971. His father was the managing director of an agricultural company, and his mother was a Ugandan-born hair salon owner.
Last year, he announced that he was engaged to his partner, a Nigerian whom he did not name publicly, saying they planned to marry and live in South Africa.