American President Barack Obama has told Kenya the United States is ready to work more closely in the battle against Somalia's Islamist group al Shabaab, but was critical of Kenya’s stance on gay rights and said no African state should discriminate over sexuality.
Mr Obama also said during his first visit as president to his father's homeland that Kenya had to tackle corruption by showing it was prosecuting culprits, saying it would spur growth. Graft is cited as a major obstacle to business across Africa.
The US president has been seeking to strengthen business ties with a continent that is home to some of the world's fastest growing economies. Earlier, he addressed a US-sponsored conference to encourage entrepreneurs.
But security was high on the agenda in talks with his counterpart President Uhuru Kenyatta, whose country has suffered a spate of attacks by al Shabaab militants.
"We have been able to decrease their effective control within Somalia, and have weakened those networks operated within this region of east Africa," Mr Obama told a joint news conference, adding Washington would give more training and funding to Kenya.
But, when Mr Obama spoke on gay rights, he said discriminating against people for their sexual orientation eroded freedoms.
"As an African American in the United States I am painfully aware of what happens when people are treated differently," he said, adding "bad things happen" when such a path is followed.
Kenya, like many African states, outlaws homosexual relations. Kenyan Deputy President William Ruto, who attended talks with Mr Obama, said in May there was "no room" for gays in Kenya.
Mr Kenyatta, who welcomed the united stance on security, said America and Kenya did not see eye-to-eye on all matters, saying gay rights were not "foremost on the minds" of Kenyans.
"There are some things that we must admit we don't share - our culture, our societies don't accept," Mr Kenyatta said.
The news briefing followed talks at State House, which were also attended by Mr Ruto, who faces charges at the International Criminal Court that he fomented ethnic killings after Kenya's disputed 2007 election. He denies them. Mr Kenyatta faced similar charges, but they have been dropped.
Mr Obama earlier addressed the Global Entrepreneurship Summit to boost US ties with a continent where China overtook the US as the continent's biggest trade partner in 2009.
"Africa is on the move. Africa is one of the fastest growing regions in the world," the US president told the conference, where he was greeted by applause as he began with the words "Jambo", the Swahili for "hello". "It is wonderful to be back in Kenya."
He told delegates governments had to establish the rule of law and tackle corruption.