The Supreme Court of Kenya elected William Ruto as President after rights arguments and court battles.
Kenya's Supreme Court unanimously upheld the results of last month's presidential election, with De Chief Justice Martha Koome dismissing all claims by the defeated Raila Odinga and the Oda petitioners.
William Ruto has been confirmed as President of Kenya by the Supreme Court.
The main petition was filed by Asimio presidential candidate Raila Odinga alleging that the Electoral Commission and the Independent Electoral and Boundaries Commission (IEBC) rigged the vote results in favor of Ruto.
D Chief Justice Martha Koome rejected all claims by the electorally defeated Raila Odinga and the ODA petitioners.
Koome says they failed to substantiate the claims.
In the election, Ruto won 50.5% of the vote while Odinga got 48.8%. The judges said some of the petitioners fabricated evidence.
Mr Ruto garnered 50.5% of the vote in the closely fought election against 48.8% for Mr Odinga.
The 55-year-old will be sworn in as the country's fifth president next week.
Following the ruling, Mr Ruto said he would extend a hand of friendship to his political opponents, and praised the judiciary and the electoral commission for upholding the "will of the people".
Despite being the current deputy president, Mr Ruto was not backed by the outgoing President, Uhuru Kenyatta, who instead campaigned for his former rival, Mr Odinga.
But Mr Ruto said he would be speaking to both men shortly and promised that his government would look after them in retirement.
"We are not enemies, we are Kenyans. Let us unite to make Kenya a nation of which everyone shall be proud to call home," he said.
In a recorded message, Mr Kenyatta congratulated the leaders who had been elected in the general elections but did not mention Mr Ruto by name.
The president, who has clashed with the judiciary several times in the past, expressed his misgivings about the Supreme Court ruling but said he would abide by it.
"The process of handing over is in progress... it is my intention to oversee a smooth transition to the next administration," Mr Kenyatta said.
The eight petitions challenging the elections were all dismissed.
The court found some were based on forged documents and "sensational information", Chief Justice Martha Koome said in a unanimous decision on behalf of the seven judges.
No credible evidence that the electronic voting transmission system had been tampered with by a supposed "middle man" was presented, she said.
Ms Koome also said that Mr Ruto had met the constitutional threshold of garnering 50%+1 of the votes cast.
The ruling ends a protracted election dispute that started after polls closed last month, leading to widespread uncertainty across the country, in case of a repeat of previous outbreaks of election violence.
Mr Odinga's team had used the dissent of four of the seven electoral commissioners - who disowned the poll results because they had fallen out with the chairman - to bolster his case.
But while noting the "dysfunction" of the commission in managing its internal affairs, the court said it was not convinced that the claims of the chairman running a one-man show was enough to undermine the election.
"Are we to nullify the outcome of an election on the basis of a last-minute boardroom rupture whose details remain scanty?" the judges asked.
The judges also reprimanded lawyers and petitioners who filed falsified documents in court - a rebuke meant to deter spurious petitions in the future.
The ruling prompted celebrations in Mr Ruto's home area of the Rift Valley and parts of the Central Province where his running mate hails from.
In Odinga's stronghold of Kisumu, there was a subdued atmosphere. Streets were deserted and some businesses were closed for the day.
Kenyans will now be watching the political repercussions of Mr Ruto's win for the main players.
Odinga has now lost five elections. At 77 it's hard to see how he will run again or even if he will remain active in opposition politics, although his statement lambasting Monday's ruling says he will continue with the "struggle for transparency, accountability and democracy".
As for outgoing President Kenyatta, who worked hard to prevent his deputy from succeeding him, it will be interesting to see if their relationship remains strained.
Most importantly, Kenya has shown that it can resolve election disputes without resorting to the violence we have seen in the past.