Updated at 10:30 a.m. ET
President Obama and Kenyan President Uhuru Kenyatta discussed strengthening cooperation in the fight against extremists, particularly al-Qaida-linked extremists based in neighboring Somalia.
On the first full day of an officials visit to Kenya — his first since becoming president — Obama said at a joint news conference that the threat from al-Shabab "was an extensive topic of conversation" in private meetings between the two leaders.
Kenyatta, referring to terrorist attacks in 2013 and earlier this year that killed more than 200 people in Kenya, called the extremist threat to his country "existential."
"The battle we are fighting is not a Kenyan war; Kenya just happens to be on the frontier," he said, referring to neighboring Somalia, long regarded as a failed state that has become a breeding ground for Islamist extremists.
The two leaders were also forced to address the uncomfortable issue of gay rights in Kenya, where, according to The Christian Science Monitor, "harassment, family rejection, evictions, school expulsions, and firings remain common."
Obama was frank, stating: "I have been consistent all across Africa on this. I believe in equal protection under the law."
He said he respected that there was a difference of opinion on the subject of homosexuality, but that "the idea that they are going to be treated differently because of who they love is wrong."
Kenyatta, who in the past has called gay rights a "non issue" in Kenya, defended that point of view.
"There are some things that we must admit that we don't share, that our cultures do not share," he said.
Bigger issues must come first, he said. "For Kenyans, gay rights are not really an issue," he said, adding that "maybe" once those larger problems can be solved, it can be addressed. "But, as of now this issue is not an issue that is on the foremost minds of Kenyans."
Earlier, Obama, attending an entrepreneurship summit in the capital, declared that Africa is a continent "on the move."
He announced a billion dollars of support for new business in Africa at the Global Entrepreneurship Summit.
As NPR's Gregory Warner reports, the president has made investing in young African entrepreneurs a focal point of his foreign policy in the region.
"Africa is on the move," Obama said at the opening of the conference where he used the traditional Swahili greeting jambo.
It's Obama's first trip to Kenya since becoming president and the first-ever visit to the east African nation by a sitting U.S. president. Even so, it is Obama's fourth visit to the continent, the most by any president.
Kenya is the birthplace of Obama's father and the biggest economy in eastern Africa.
"Africa is one of the fastest growing regions in the world," he said.
"Entrepreneurship offers a positive alternative to the ideologies of violence and division that can all too often fill the void when young people don't see a future for themselves," the president said.
"You don't have to look a certain way, or be of a certain faith or have a certain last name in order to have a good idea," he said.
Gregory reports: "As on previous trips to Africa the president brought a coterie of American venture capitalists and would-be investors, with a special focus on encouraging African women entrepreneurs."
The president arrived in Nairobi on Friday, where he was greeted by Kenyatta and by his half-sister, Auma Obama.