The International Criminal Court has indicted him for allegedly funding a local militia that conducted reprisal attacks in the last election in 2007. His running mate, William Ruto, also faces ICC charges at The Hague, in the Netherlands.
Both have denied the charges and have said they will cooperate with the court to clear their names.
Analysts say the ICC indictment may have rallied citizens to Kenyatta's side in defiance of the West.
"Many Africans have lost faith in ICC and view it as targeting African leaders and failing to discharge its justice among non-African leaders," said Ayo Johnson, director of ViewPoint Africa. "Kenya sent a loud message to the ICC ... don't interfere. And it does not matter if you brand our leaders as criminals."
But rights group say the courts are vital to providing justice in cases largely overlooked by governments.
Kenyatta has said the indictment will not affect his ability to do his job, and has urged the international community to respect the will of Kenyans.
The United States and Britain sent accolades to Kenyatta following the ruling. Before elections, officials from both nations had expressed concerns over ICC charges against the president-elect.
British Prime Minister David Cameron wrote to Kenyatta to congratulate him, a Downing Street spokesman said Saturday.
Cameron "urged the Kenyan people to be proud of the strong signal they have sent to the world about their determination to exercise their democratic right peacefully," the spokesman said.
In a statement, the White House also congratulated Kenyatta and urged Kenyans "to peacefully accept the results" of the election.
U.N. Secretary-General Ban Ki-moon also talked to Kenyatta and Odinga and pledged the United Nations' support for the country.