The election of Uhuru Kenyatta is a storybook ending for the son of Kenya's first president.
But despite his popularity at home, he is facing charges of crimes against humanity at the International Criminal Court over the 2007 post-election violence in Kenya, putting the West in a dilemma in its fight for human rights in the continent.
Kenyatta, 51, narrowly eked out a win, and will become the youngest president of East Africa's largest economy. His challenger, Raila Odinga, has said the vote is flawed, but lost a challenge brought in the Supreme Court.
Analysts say Kenyatta's victory signals a growing discontent against Western intervention in the continent.
In his victory speech, Kenyatta noted the sentiment.
"Today, we celebrate the triumph of democracy; the triumph of peace; the triumph of nationhood," he said. "Despite the misgivings of many in the world, we demonstrated a level of political maturity that surpassed expectations."
Africans have accused the International Criminal Court, based in The Hague, in the Netherlands, of targeting the continent's leaders.
"Kenya sent a loud message to the ICC ... don't interfere," said Ayo Johnson, director of ViewPoint Africa. "And it does not matter if you brand our leaders as criminals."
Grooming for power?
In retrospect, it appears Kenyatta's path from childhood may have been preparing him for his new role.
His earliest memories revolve around the state house -- the nation's equivalent of the White House -- where he scampered down hallways when his father, Jomo Kenyatta, was serving as the nation's first post-independence president.
Born in 1961, two years before Kenya officially got independence from Britain, his parents named him "Uhuru" -- Swahili for freedom -- in anticipation of the nation's liberation from colonial rule.
At a young age, he brushed shoulders with some of the nation's prominent figures. His online photo album includes receiving a history award from Mwai Kibaki at a young age, the man he is replacing as president.
Kenyatta attended high school in the capital of Nairobi, where he was a winger in a rugby team.
Two years after his father died in 1978, Kenyatta joined Amherst College in Massachusetts, where he studied economics and political science.
He returned home after graduation and launched a horticulture business, which he later sold, and focused on the extensive family businesses his father left behind.
His family's empire includes hundreds of thousands of acres of land, often a cause of resentment amid the grinding poverty in the nation.
Politics and mentors
Kenyatta dipped into politics as a fierce supporter of the Kenyan African National Union, which ruled the nation from Independence until 2002.
After his father's death, Daniel Arap Moi took over the leadership of the party and the nation. He took the younger Kenyatta under his wing, mentored him and secured him a position in his government.
When Moi decided not to run for re-election in 2002, he designated Kenyatta as his candidate of choice.
Kenyatta lost to current incumbent president, Kibaki, partly because of his ties to Moi, who was resented for overstaying his welcome as president.
Despite Kenyatta's loss at the polls, he became known for more than his father's last name.
When Kibaki sought to change the constitution to strengthen the president's powers, Kenyatta teamed up with then-opposition leader Odinga to rally against the change.