US President Barack Obama on Sunday told Kenyans to make "tough choices" if they want to improve their lives for the better.
While addressing a gathering in Nairobi, Mr Obama recalled the progress Kenya has made over the years.
He, however, said the country has to embrace its own destiny so as to travel the long road of prosperity.
Of concern to him were the issues of corruption, tribalism, insecurity (violent extremism) and the marginalisation of certain communities, issues he argued were eating into the country's progress.
"Kenya is at a crossroads, in a moment of pain but also a moment of great promise,” he told the audience gathered at the Safaricom Indoor Arena.
"You can't be complacent and accept the world just as it is. You have to imagine how the world should be."
Mr Obama, the first US president to visit Kenya, was speaking to Kenyans following a two-day visit in which he attended the Global Entrepreneurship Summit as well as holding bilateral talks with President Uhuru Kenyatta.
Throughout his 40-minute speech, he referred to his Kenyan roots (his father was Kenyan), his past visits and how the country had changed for the better, including adopting a new Constitution.
But he was categorical that many things must still be done to remove the country from its current position.
"Politics that is based solely on tribalism is the politics that is doomed to tear the country apart," he said.
"Kenya has come from far, but it was nearly torn apart by the 2008 violence," he said, referring to the clashes that resulted of the disputed December 2007 elections.
"Kenyans chose to stay together. In part, because of this stability, Kenya's economy is also emerging.
"I am standing here as a friend who wants Kenya to succeed, but tough choices are going to be made in order to reach that destination."
He talked of the three pillars of democratic governance, equitable development and pursuing peace and reconciliation as the assured way out of the current challenges.
Corruption, he argued, was costing Kenya 250,000 jobs a year, though he admitted the problem is not unique to Kenya.
Both small fish and big fish must be targeted, habits changed and a culture of ethics inculcated, he argued.
"I don't want anyone to get sensitive. But in many countries, as is Kenya, corruption is tolerated because that is how things are often done,” he told the audience, which also included senior government officials and members of the Opposition.
INVEST IN WOMEN AND YOUTH
Though Kenya is the biggest economy in the region, Mr Obama argued that not everyone is benefitting.
While this is a normal challenge, it is the way Kenyans will address it that will make a difference, he said.
He said Kenya needs to invest more in the youth and women.
"These young people are not weighed down by the old ways. They are pursuing a new path," he said.
For women, the government must crack down on "bad traditions" of female genital mutilation, policies that isolate them as well as domestic violence, he added.
"There is no excuse for sexual assault or domestic violence. They have no place in the 21st century.
"Any nation that fails to educate its women is doomed to fall behind the world economy," Mr Obama emphasised.
On terrorism, President Obama said the US will work "shoulder to shoulder" with Kenya to defeat violent extremism.
But the support will be conditional: it should not involve targeting Muslims or other communities