Kenya's Deputy Prime Minister Uhuru Kenyatta has been confirmed as the winner of the presidential election.
Mr Kenyatta won 50.07% of the vote on a turnout of 86%, officials said, narrowly avoiding a run-off ballot.
However, his main rival, PM Raila Odinga, alleged voting irregularities and is expected to file a challenge.
Mr Kenyatta is also set to face trial at the International Criminal Court in The Hague over violence that followed Kenya's 2007 elections.
He is accused of fuelling the communal violence that saw more than 1,000 people killed and 600,000 forced from their homes.
The IEBC said the latest elections had been complex and difficult but also credible and transparent.
It said the turnout was the largest ever.
Independent Electoral and Boundaries Commission (IEBC) chairman Issack Hassan said that Kenyans had voted "calmly, patiently, proudly and peacefully in the full glare of whole world".
Mr Kenyatta denies fuelling communal violence after the 2007 presidential vote
Announcing the final vote count, he said: "I therefore declare Uhuru Kenyatta the duly elected president of the Republic of Kenya."
Mr Hassan praised the candidates who had already conceded defeat and urged others to follow suit.
However, one of Mr Odinga's aides - speaking before the announcement - said the candidate had "no intention" of conceding defeat.
Salim Lone told the Daily Nation newspaper: "The level of the failures in the system makes it very difficult to believe it was a credible result."
Both candidates have complained of irregularities during the course of the count, since Monday's election.
Mr Kenyatta won 6,173,433 votes out of a total of 12,330,028.