President Barack Obama concluded his visit to Kenya on Sunday -- the first by a sitting U.S. president -- with a speech in which he praised the advancements made by the east African country in a number of areas over the years, but also warned of the challenges ahead.
"Kenya is at a crossroads, a moment filled with peril but enormous promise," he told a crowd of thousands at a stadium in Nairobi.
Obama also welcomed Kenya's newfound political stability, pointing out that young Kenyans today did not have to emigrate, like his father did, in search for a better life.
"Because of Kenya's progress, because of your potential, you can build your future right here, right now," he said to raucous applause from the crowd.
But the U.S. leader also told his Kenyan counterpart his government must do more to stamp out corruption, which he referred to as a "cancer," and improve its human rights record.
Kenya, a country with some 40 different clans, is a nation steeped in tribal and ethnic divisions. On Sunday, Obama urged Kenyan President Uhuru Kenyatta to put those rivalries aside for the greater good of the nation.
"A politics that's based on only tribe and ethnicity is doomed to tear a country apart. It is a failure -- a failure of imagination," he said.
The U.S. president also called for a greater role for women and girls in Kenyan society.
"Treating women and girls as second-class citizens, those are bad traditions. They need to change," Obama said to applause. "They're holding you back."
Kenyan officials have also come under fire in recent months over their attitudes towards the LGBT community. Last year, an Anti-Homosexuality Bill that would punish homosexuality with life in prison, or death by stoning, was brought up for debate before the National Assembly.
In a joint news conference on Saturday, Obama told Kenyatta about the dangers of discriminating against his own people.
"When you start treating people differently not because of any harm they are doing to anybody, but because they are different, that's the path whereby freedoms begin to erode," he said as Kenyatta stood next to him.
Kenyatta, however, was nonplussed by Obama's remarks, maintaining that in Kenya LGBT rights was not up for debate.
"It is very difficult for us to be able to impose on people that which they themselves do not accept," Kenyatta said. "This is why I repeatedly say that, for Kenyans today, the issue of gay rights is really a non-issue."
While divided on the issue of LGBT rights, Obama and Kenyatta said they remained "united against terrorism."
Obama's trip to the land where his father was born also included a visit to the memorial of those killed in the 1998 U.S. Embassy Bombing.
Later on Sunday, Obama will fly to Ethiopia -- in another first visit by a sitting U.S. president -- from where he will address the African Union on Tuesday.