CAPE TOWN, South Africa — When South African airport officials threatened to send Dr. Paul Semugoma back to his native Uganda, he shook with fear.
Semugoma, an outspoken gay activist, was determined to remain in this country, where he has lived for two years, rather than be sent back to one of Africa's most homophobic countries.
Held by immigration officers after returning to South Africa with an expired visa, he was allowed to stay only after an outcry from human rights groups mindful of new legislation in Uganda calling for life in prison for those who engage in repeated acts of gay sex.
The harshness of the law signed days later by Ugandan President Yoweri Museveni — and similar strictures in more than three dozen African nations — is triggering a profound reaction in Africa.
For every repressive law, there's an answer from African writers, intellectuals, politicians, doctors and activists. Despite the setbacks, gays and lesbians are increasingly coming out in countries where laws are not enforced, penalties are not as harsh or don't exist.
In an open letter last month, former Mozambican President Joaquim Chissano called on all African leaders to protect gay rights. Retired Anglican Archbishop Desmond Tutu of Cape Town compared Uganda's anti-gay law to Nazi Germany's repressions.
Renowned Nigerian writer Chimamanda Adichie chimed in with a powerful condemnation of her country's anti-gay legislation, which was signed into law in January.
But the change was perhaps best illustrated by an essay by prominent Kenyan writer Binyavanga Wainaina, titled "I am a homosexual, Mum," penned partly in anger over laws in Nigeria and Uganda.
Wainaina said he had known he was gay from the age of 5. Placing himself back in his younger years, he said the recognition "comes every few months like a bout of malaria and leaves me shaken for days, and confused for months."
He never told his parents. He didn't touch a man sexually until he was 35, and couldn't use the word "gay" for four years after that.
His essay begins with a story that didn't happen. Instead of his self-absorbed, busy life in South Africa, instead of somehow failing to get to his mother's side in a Nairobi hospital, his essay has him there, head on her shoulder, gently clasping her hand, which is swollen with the effects of diabetes, whispering the truth. She is awake, listening, dying:
Nobody, nobody, ever in my life has heard this. 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.
Dozens of men are behind bars in Africa, awaiting trial on sodomy charges or already convicted under anti-gay legislation that, according to Amnesty International, exists in 38 African countries. Ethiopia is expected to toughen its legislation next week.
The harsh new punishments in Nigeria and Uganda — signed with a populist flourish by Presidents Goodluck Jonathan and Museveni, respectively — seem designed to garner easy support for governments and leaders with poor records, said Dawie Nel, spokesman for Out, a group in Pretoria, South Africa, representing gays, lesbians and bisexual, transgender and intersex people.
In Nigeria, the president's move prompted a flurry of arrests, as well as riots outside a court where men faced trial for engaging in gay sex. In Uganda, activists worry that the law, and the president's accompanying speech branding homosexuality "disgusting," will incite homophobic attacks.
Semugoma says that growing up in Uganda, he knew he was gay. But he was in denial. As a teenager, he joined an evangelical church and convinced himself that "sex was evil." He later immersed himself in medical studies. But his denial eventually flaked away like a coat of bad paint.
"I couldn't hide from myself that I was attracted to other guys," says Semugoma, 43. "I was very lonely. I hid in my books. I hid in my religion, but religion was wearing out. I couldn't talk to anyone about it."
Two years ago, after the slaying of an activist friend, Semugoma left for South Africa, whose constitution guarantees equal rights for gays, lesbians, transgender people and others. He recently took part in an annual gay pride march.
"The one thing Uganda taught me," he says, "is I have to celebrate who I am."