However his main rival, Raila Odinga, vowed to challenge the result in court.
Mr Kenyatta is set to be tried at the International Criminal Court over violence that followed the 2007 polls.
At the sceneKibera slum is not normally considered friendly turf for Uhuru Kenyatta. Yet residents remained calm after the election of Kenya's richest man as their next leader. People are placing their faith in the new constitution and recent judicial reforms.
Raila Odinga is challenging the results in the Supreme Court and people say they will wait for the legal process to run its course.
Some point to the reforms as a reason for the relative calm compared with five years ago, when Kibera was a flashpoint. "Our behaviour is being shaped by the new constitution," said Steve, a Kibera resident.
But there are worries about the future. Many hope Mr Kenyatta will uphold the new constitution and continue to co-operate with the International Criminal Court, where he is fighting charges of crimes against humanity.
While the mantra across Kenya is "amani" (peace), some campaigners are warning against a "peace coma" - a failure to address past injustices which would prevent Kenya from moving on.
On Saturday the election commission said Mr Kenyatta had narrowly avoided a run-off by winning 50.07% of votes in a credible and transparent poll.
It said the turnout, at 86%, was the largest ever in the country.
The BBC's Gabriel Gatehouse in Nairobi says it was the closest of races with the tightest of margins.
After the results were announced, Mr Kenyatta told cheering supporters he would serve all Kenyans "without fear or favour".
Speaking at the Catholic University in Nairobi, he said Kenyans were celebrating the "triumph of democracy, the triumph of peace, the triumph of nationhood".
Voters, he said, had "demonstrated a level of political maturity that surpassed expectations", and he called on Mr Odinga and other leaders to "join us in moving our nation forward".
However Mr Odinga, the current prime minister, said the election commission had "failed Kenyans" and that democracy itself was "on trial".
He announced that he would challenge the results of a "tainted election" in the Supreme Court.
He also appealed for calm, saying: "Any violence could destroy this nation forever."
The count has been plagued with technical glitches, including a programming error that led to the number of rejected votes being multiplied by a factor of eight.
- Aged 51
- Son of founding President Mzee Jomo Kenyatta
- Heir to one of the largest fortunes in Kenya, according to Forbes magazine
- Entered politics in 1990s, groomed by former President Daniel arap Moi to be his successor
- Known as "njamba" ("hero") in his Kikuyu language
- Indicted by ICC on charges of crimes against humanity for 2007 post-election violence - which he denies
- Married father of three
How Mr Odinga now handles his supporters will determine whether his dispute stays in the courts or spills out on the streets, our correspondent says.
Western powers welcomed the peaceful vote but avoided mentioning Mr Kenyatta.
Ahead of the election, the US and the UK had hinted that his election would complicate relations because of the charges of crimes against humanity he faces.
US Secretary of State John Kerry called the election a "historic moment" and said America would "continue to be a strong friend and ally" of the Kenyan people.
The British Minister for Africa, Mark Simmonds, urged all sides to show restraint.
In July Mr Kenyatta is due to go on trial at the International Criminal Court (ICC) in The Hague
His running mate, William Ruto, also faces similar charges. Both men deny the accusations.
In his victory speech, Mr Kenyatta restated his promise to co-operate "with all nations and international institutions".
The ICC has agreed to postpone Mr Ruto's trial by a month until May after his lawyers complained they did not have enough time to prepare his defence.