President Obama, wrapping up his three-day visit to Kenya, urged the east African country to "choose the path to progress" by tackling corruption, eliminating income inequality and promoting gender equality.
"I'm here as president of a country that sees Kenya as an important partner. I'm here as a friend who wants Kenya to succeed," he said in a speech at the Safaricom Indoor Arena in Nairobi.
"You can choose the path to progress, but it requires making some important choices," he said in the 40-minute speech that was broadcast on Kenyan television.
Obama, who was introduced by his half-sister Auma Obama, told the crowd of his first visit to Kenya in the 1980s when she picked him up at the airport in an old VW Beetle. This time, he arrived in Air Force One, he said.
"When it comes to the people of Kenya, particularly the youth, I believe there is no limit to what you can achieve," he said, adding that Kenyans need to exert personal responsibility to make it happen.
On the subject of corruption, which has slowed growth in Kenya, the president said "doing an honest day's work" is better than taking a bribe.
As The Associated Press reports:
"Obama also pressed for more tolerance and respect of women and girls, calling for an end to violence against women, forced marriages for girls who should otherwise be attending school, sexual assault and the tradition known as "genital mutilation."
"'These traditions may date back centuries. They have no place in the 21st century,' he said."
The president has also pledged to step up aid to Kenya to combat the al-Qaida-linked al-Shabab extremist group, based in neighboring Somalia, but as NPR's Gregory Warner, reporting from Nairobi, says, "he's chastised the Kenyans for broad-brush approaches that alienate the Somali community and increase the pool for terrorist recruitment."
Gregory says: "Obama has considerable influence here in Kenya. Some of the attendees here at the stadium were shouting 'Obama for president, 2017' – that is, Kenyan president."
Obama's next stop is Ethiopia, which was devastated by famine in the 1980s but has rebounded economically, becoming one of the continent's fastest-growing economies. However, its human rights record is not as bright.