President Obama’s first visit to Kenya as U.S. president concluded on Sunday and, for all intents and purposes, the journey went well: Obama was greeted by adoring crowds throughout the country and was also able to meet with a number of his relatives.

But the trip did include one tense moment. Appearing at a press conference with his counterpart, Kenyan President Uhuru Kenyatta, on Saturday, Obama spoke out about the importance of gay rights in the country.

“As somebody who has family in Kenya and knows the history of how the country so often is held back because women and girls are not treated fairly, I think those same values apply when it comes to different sexual orientations,” he said. He then likened anti-gay discrimination as “the path whereby freedoms begin to erode and bad things happen.”

Kenyatta didn’t take the bait. “For Kenyans today, the issue of gay rights is really a non-issue,” he said. “We want to focus on other issues that really are day-to-day issues for our people.” Kenyans in attendance applauded his remarks.

Gay equality has a long way to go in Africa. Of the continent’s 54 countries, only one, South Africa, has legalized same-sex marriage. In many others, opposition to homosexuality is nearly universal. According to a 2013 survey by the Pew Research Center, 98 percent of the population of Nigeria, the continent’s largest economy, believe homosexuality should not be part of society. The percentages in Senegal and Ghana were scarcely lower. In Uganda, where public opposition reaches 96 percent, rights activists achieved a rare victory in 2014 with the overturning of a law mandating life in prison for many instances of gay sex. But months later, a similar piece of legislation was enacted in Gambia. Attitudes in the continent’s southern countries aren’t much more tolerant. When a Supreme Court decision legalized gay marriage in the United States last month, Zimbabwe president Robert Mugabe remarked that he would take the opportunity to propose marriage to Obama himself.

In many ways, the situation for LGBT individuals in Kenya is less bleak. Gay and lesbian Kenyans have appeared on television and received respectful coverage in the national media, and gay-friendly clubs are known to exist in Nairobi, the capital. In April, Kenya’s high court legalized a gay-rights organization for the first time. But homophobia remains rampant throughout the country, infecting even the top leadership. After April’s ruling William Ruto, Kenya’s deputy president, said in a speech that “we would not allow homosexuality in our nation, as it violates our religious and cultural beliefs.”

Despite Ruto’s frank bigotry—he has also referred to homosexuality as a “dirty act,” a comment that Obama said he “disagreed with”—Kenya’s reticence to accept gay rights exists for a variety of reasons. According to Howard French, a former New York Times correspondent in West Africa now at Columbia University, Obama’s call for tolerance—however well-intentioned—resonated with an welcome tradition of Western leaders lecturing Africans on ways they could improve.

“Africans have been subjected to the judgments of others: what’s right for them, what they’re ready for more than anything else,” French wrote on Twitter on Sunday, adding that “calling something cultural imperialism has nothing to do whether one is in agreement or not with a particular piece of advice.”

A BBC clip filmed on the eve of Obama's arrival presented Kenyans expressing a similar aversion to American meddling. Some of the individuals interviewed announced their support for gay rights—or at least a desire for the government to leave LGBT people alone. But others argued that Obama ought to respect the fact that other countries do not share the American point of view.

“If [Kenyan people] are not comfortable with the gay rights, then [Obama] shouldn’t push,” said a young woman in the clip. “He shouldn’t force it on Africans.”

There is also concern that American advocacy for gay rights may backfire on the continent. After Gambia and Uganda passed their laws criminalizing homosexuality, the U.S. imposed sanctions on the two countries. But according to The New York Times, the sanctions merely hardened public opposition to gay rights.

Do Obama’s comments in Kenya carry that risk? Likely not. And at the very least, they force a national conversation on a topic that the Kenyan government would rather not discuss at all.

“Obama’s message resonated with many Kenyans, and will be debated and work its way through society,” wrote French.