Everyone knew President Obama would say something about gay rights when he visited Kenya last summer. Many American activists were pressing him to publicly condemn Kenya's colonial-era law making homosexuality a crime.

But Kenyan gays and lesbians were wary. In the weeks leading up to Obama's visit, Kenyan politicians took to the airwaves to assert their anti-gay bona fides. Deputy President William Ruto gave a guest sermon in a church to announce that Kenya "had no room" for homosexuality. As the vitriol increased, so did the incidents of violence, from assaults to rape.

"That was the most tense [period] in our life, before Obama came," says John Mathenge, the director of a community center and health clinic in Nairobi calledHOYMAS — Health Options for Young Men with HIV/AIDS and STIs. His clinic usually averages 50 visitors a day; in the weeks before Obama's arrival there were no more than two or three. "People weren't even coming to collect their ARVs [anti-retroviral medication] because they feared they were going to be attacked."

It wasn't just Kenyans who were worried. OutRight Action International, a New York-based not-for-profit that advocates for LGBT rights around the world, took the position that President Obama should not mention gay rights when he visited Kenya.

"LGBTI rights have become a political lightning rod," explained OutRight director Jessica Stern. Though the organization is devoted to pressing for gay rights overseas, she urged the U.S. government to push for "substance over symbolism" — that is, working behind the scenes to improve the legal and social climate for LGBT people rather than issuing too many public pronouncements that could be seen as finger-wagging and that could compromise the efforts of local activists. "We know it's very easy for LGBTI Africans to be discredited as Western," she said. (The acronym is a version of LGBT and stands for "lesbian, gay, bisexual, transgender and intersex.")

Over the past four years, the U.S. government has engaged in an ambitious campaign to defend the rights of gay and lesbian people overseas, especially in Africa, where the majority of countries outlaw homosexuality and anti-gay sentiment remains strong. But African activists struggle with the double-edged sword of American support. While they say that U.S. attention has given a needed boost to their movement, the protection of an outsider can complicate the path to true acceptance.

John Mathenge, the director of the HOYMAS clinic, is not the type to avoid conflict: He's an openly gay man in Kenya and a plaintiff in a suit to strike down the the law that makes homosexuality illegal. He has sought out the spotlight, despite the dangers. But he bristles when his opponents dismiss him as a "Western agent" or "Obama's agent" because he's gay. The politicization of his identity makes it harder to have those one-on-one conversations with ordinary Kenyans — his neighbors or shopkeepers — to gain their trust.

So on July 25, 2015 — the day of Obama's visit — Mathenge watched the bilateral presidential press conference on TV with a mix of hope and anxiety. He was proud, and a little worried, when President Obama, as expected, defended gay and lesbian rights as part of "the principle of treating people equally under the law."

When Kenyan President Uhuru Kenyatta rose to respond, he seemed at first to refuse Obama's call to support LGBT rights, saying: "It's very difficult for us to be able to impose on people that which they themselves do not accept." But then Kenyatta uttered an ambiguous phrase, one that appeased both Kenyans opposed to gay rights and also members of the Kenyan LGBT community. He said, "For Kenyans today, the issue of gay rights is really a non-issue."

Kenyan LGBT activists say that phrase saved lives. While some American commentators read it as a further rebuttal to Obama or even a rationalization for anti-gay violence, many Kenyans saw it as a call to drop the issue. Many Kenyan politicians stopped spouting anti-gay rhetoric. An anti-homosexuality bill in parliament — which would have been far more onerous than Kenya's current statute — was quietly dropped.

Would LGBT Africans be safer if their supporters were more like Kenyatta and less like Obama? Has public advocacy from America to make gays and lesbians more visible also left them more vulnerable?

Probably so, says Julie Dorf, a senior adviser at the Council for Global Equality — but she's quick to add that the backlash is not America's fault. The rise of anti-gay violence and anti-gay legislation in parts of Africa, she says, is a response to the success of an indigenous gay rights movement that the U.S. has helped foster. She points to recent legislative victories on the continent: the African Commission on Human and People's Rights issued a first-ever resolution condemning violence against LGBT people; Mozambique and Seychelles decriminalized same-sex acts; and a draconian Ugandan law (once dubbed by activists, in a previous incarnation, the "Kill The Gays Bill") was invalidated by the Ugandan High Court, a ruling that many credit to U.S. pressure.

Other African countries have not only cracked down harder on gay people and gay rights groups but used that crackdown to muzzle other human rights efforts. Graeme Reid, director of the LGBT Rights Program at Human Rights Watch, agrees that "politicians manipulate this issue for their own ends using whatever rhetoric is convenient at the time." Gays and lesbians and transgender people would be political scapegoats whether or not America was involved. But the Western support does add "complications," he says, for example, when the international community appears to express more outrage about anti-gay violence than about political violence or election rigging. Reid says "it can sometimes be the case that international voices speak out more vocally around LGBT issues than around other human rights abuses and that does create a very skewed perception ... that [Western] countries are only outraged about violations against LGBT people."

Pepe Julian Onziema, a transgender activist in Uganda, won a GLAAD Media Award last year for outstanding talk show episode. He was honored for an interview with John Oliver on HBO's Last Week Tonight. Asked, "Are you safe in Uganda," Onziema said, "Not really. I"m not exactly safe. But to an extent I'm safe because I stand my ground." Stephen Lovekin/Getty Images for GLAAD

The perception in some African countries — that gays and lesbians and transgender people are a group with special status in the West — can be both a blessing and a curse. Pepe Julian Onziema experienced this, in a terrifying way, earlier this month. A transgender man and Ugandan LGBT activist, Onziema was arrested at a gay pride event at a private bar in Kampala. It was his fifth arrest in Uganda, but this time, not only were the police much more violent — beating him with batons on the way to the station — but they also expressed hate for his perceived privilege. "They're like OK, let's see how your American money is going to get you out of this today," Onziema remembers the police saying. "It's definitely connected to the perceptions that they have about us. That we have money, that the West has given us money. And that the West is protecting us."

Onziema says he can understand his tormenters. Because he's a well-known LGBT activist in a country where America is paying attention to the issue, Onziema enjoys a political clout far out of reach of the average Ugandan. He can call a U.S. diplomat or Ugandan parliamentarian on his cellphone. These Ugandan cops resented him for it. Once off the police truck and booked at the station, Onziema was tossed into a prison cell where inmates were instructed to "take care" of him. They began by beating him. The beating was followed by a public stripping, forced showers and other acts of humiliation. Then came the rape threats. Onziema says the situation could have gotten much worse, for him and the others arrested at the bar, had they not been released about an hour later.

That quick release was thanks largely to the intervention of the U.S. Embassy, which was alerted by the hurried tweets and phone calls that Onziema and others had sent out earlier. The irony was not lost on Onziema that they were saved, if not by American money per se then certainly by their access to Americans. "Our so-called U.S. money saved us anyway," Onziema sighed.

When I ask him why he sighed, he spelled out a cruel paradox: The more public protection he gets from America, and from the American-backed Ugandan government, the more he can become an object of envy and outrage by ordinary Ugandans and thus the more protection he seems to need. "The irony of American money, it's the power it gives you, and then how powerless it leaves you at the same time," he said.

But how should Americans feel about that? I asked him.

Onziema paused for several long seconds, tugging on his left ear. It had been less than 48 hours since his release from jail, and he was still having trouble hearing from that ear because of the beating he'd received behind bars. Finally he smiled, a wry smile. "I think the fact that I'm sitting here talking to you? They should feel proud."