David Cameron said he hoped the decision of Kenya's supreme court to uphold the election of Uhuru Kenyatta as president would be accepted peacefully as "final" by its people.
Downing Street said the Prime Minister had written to the president-elect congratulating him and saying the peaceful election sent a "strong signal" after violence killed more than 1,200 following a disputed poll in 2007.
Tensions were raised again in the country as it awaited the verdict of a drawn-out case brought by challenger Raila Odinga, who claimed irregularities meant the result should not stand.
Official results gave Kenyatta 50.07 % of the vote, meaning he narrowly avoided a run-off with his rival.
Chief justice Willy Mutunga said the court had agreed unanimously that the election had been conducted "in compliance with the constitution and the law" and the result was valid.
Mr Kenyatta and his deputy-elect William Ruto both face charges at the International Criminal Court - which they deny - that they were involved in orchestrating the deadly violence after the last election.
In a statement, Number 10 said Mr Cameron had written to congratulate Mr Kenyatta and others elected in the recent poll. "He stressed that this represented the end of a remarkable process, in which more Kenyans than ever before turned out to vote," a spokeswoman said.
"The PM 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. He encouraged all Kenyans to continue this spirit of peace and accept the decision of the court as final.
"The Prime Minister stated that the Kenyan people had made their sovereign choice, and resolved disputes through the rule of law and the strong institutions of the supreme court and due constitutional process. He welcomed the president-elect's commitment that his new Government will work with all Kenyans in a spirit of inclusivity and reconciliation, and that the government of Kenya will continue to meet its international legal obligations."
Mr Cameron also hailed the "deep and historic" relationship between Kenya and the UK "with a substantial shared agenda of stability, security, development and prosperity".