NAIROBI, Kenya (AP) -- President Barack Obama nudged African nations Saturday to treat gays and lesbians equally under the law, a position that remains unpopular through much of the continent. Obama's Kenyan counterpart responded by calling the matter a "non-issue" for his country.
Obama tackled the sensitive matter on his first full day in Kenya, the country of his father's birth. He drew on his own background as an African-American, noting the slavery and segregation of the U.S. past and saying he is "painfully aware of the history when people are treated differently under the law."
"That's the path whereby freedoms begin to erode and bad things happen," Obama added during a joint news conference with Kenyan President Uhuru Kenyatta. "When a government gets in the habit of treating people differently, those habits can spread."
Kenyatta was unmoved, saying gay rights "is not really an issue on the foremost mind of Kenyans. And that is a fact."
A number of Kenyan politicians and religious leaders had warned Obama in outspoken terms that any overtures on gay rights would not be welcomed in Kenya, where gay sex is punishable by up to 14 years in prison. The Kenyan gay community also complains of sometimes violent harassment.
Obama's visit to Kenya -- the first by a sitting U.S. president -- has been long sought by this East African country where he is widely considered a son of the nation.
Acknowledging that some Kenyans have been frustrated that it took him until the seventh year of his presidency to visit, Obama joked that he didn't want the rest of Africa to think he was "playing favorites." He will also visit Ethiopia on this trip.
Still, he noted the U.S. had concerns about violence that erupted in Kenya after its 2007 election. Kenyatta faced charges related to that violence in the International Criminal Court, though those charges were later dropped. Deputy President William Ruto, however, still faces charges at the ICC.
Obama said he was encouraged by statements Kenyatta has made about the need to root out corruption in the country, saying that's one issue that could slow down Kenya's economic growth and development.
Much of Obama's discussions with Kenyatta centered on counterterrorism cooperation. Kenya has been grappling with deadly attacks from extremists, most notably Somalia-based al-Shabab, a network linked to al-Qaida.
Al-Shabab has conducted major attacks in Kenya, including the 2013 attack on Nairobi's Westgate mall and an April attack in Garissa that killed nearly 150 people.
"This is an existential fight for us," Kenyatta said.
The two leaders opened their day-long meetings with a joint appearance at the Global Entrepreneurship Summit, a U.S.-sponsored business conference. Obama announced $1 billion in commitments from the U.S. government, as well as American banks, foundations and philanthropists.
"Africa is on the move," Obama declared.
Obama's election in 2008 was cheered in Africa, not just because of his family ties, but also because there was an expectation that he would devote significant attention to the continent. Those high hopes have been met with some disappointment, given that Obama's foreign policy has instead focused heavily on boosting ties with Asia and dealing with conflict in the Middle East.
The White House rejects that criticism, noting that Obama is making his fourth trip to Africa, more than any previous president. Officials are particularly sensitive to criticism that Obama's Africa policies pale in comparison to his predecessor, George W. Bush, who launched a multi-billion dollar HIV/AIDS initiative.
On Saturday, Obama said many of his African initiatives, including a program to vastly increase access to power, were intended to be years-long efforts. And he credited Bush's health programs with saving millions of lives.
"This isn't a beauty contest between presidents," he said.
In addition to his official agenda, Obama's visit to Kenya has been a reunion of sorts with his late father's family. Shortly after arriving in Nairobi Friday night, Obama held a private dinner with three dozen family members, including his half-sister Auma Obama and step-grandmother Sarah Obama.
"The people of Kenya will be familiar with the need to manage family politics sometimes," he said. "There are cousins and uncles and aunties that show up that you didn't know existed."
The president has written emotionally about his first visit to Kenya nearly 30 years ago, a trip aimed at learning about the father he barely knew. Obama's father traveled to the U.S. as a student, but left when his son was 2 years old. They would only see each other once more before the elder Obama died in a car crash in 1982.
Unlike on his original trip as a private citizen, security and logistical constraints prevented Obama from traveling to Kogelo, the rural village where his father lived and is buried. The president begged for forgiveness from his family and promised he would be back.
"The next time I'm back, I may not be wearing a suit," he added.