President Uhuru Kenyatta last evening described his re-election as a validation of his victory in the August poll whose results were nullified by the Supreme Court.
He declared his readiness to obey the court if the election is nullified a second time.
Speaking after the electoral commission chairman Wafula Chebukati handed him the winner's certificate for the second time in 81 days, he criticised his main opponent's decision to pull out of the contest despite winning his petition at the Supreme Court on September 1.
He ruled out the possibility of dialogue with the opposition at this time and was cautious about stating his agenda since he anticipates a contest at the apex court.
"My victory today is just part of a process that is likely to once again be subjected to a constitutional test through our courts.
"As I have demonstrated repeatedly, I will submit to this constitutional path despite its outcomes," he said at the Bomas of Kenya, the Independent and Electoral Boundaries Commission (IEBC) national tallying centre.
Mr Chebukati declared him the winner of the October 26 election with 7,483,895 votes of the 7,616,217 valid votes cast.
Calculated against the 19,611,423 registered voters, turnout was at 38.84 per cent.
President Kenyatta had 8,203,290 votes in the August election -- 719,395 more than in last week's poll.
"As I have said, this is an ongoing process, the people of Kenya have decided, the IEBC has made its announcement as to the verdict of a free and fair democratic election... There is still another process and we shall wait for its outcome," President Kenyatta said.
There were celebrations in Jubilee strongholds of Central Kenya, Rift Valley and sections of Nairobi while protests in Nasa regions greeted the declaration.
In Nairobi's Kibera, youth engaged police in street battles immediately after the announcement.
US envoy Robert Godec had earlier in the day called for dialogue between Jubilee and the opposition but President Kenyatta said he would only engage in that after his main opponent Raila Odinga exhausts all the legal avenues available to challenge his re-election.
"Let them go to court. Nobody shall deny them their constitutional right. All these issues we shall discuss later.
"As to my agenda going forward, I will discuss once the processes are over. I will not jump the gun," he said to applause from the Jubilee supporters and leaders who occupied more than half of the auditorium, joining former presidents Rupiah Banda and Thabo Mbeki, envoys and UN representatives Sahle-Work Zewde and Siddarth Chatterjee and other election observers.
Both President Kenyatta and the commission appeared ready for a contest at the Supreme Court, given that there was a petition to postpone the elections just a day before they were held.
President Kenyatta praised Kenya's resilience in the face of a political crisis that has seen the economy wobble and polarised people on political lines.
"Any other country experiencing the turns and twists of our recent electoral process would have burst asunder, but our Kenyan resilience will not die. It will not give in to obvious provocations and the politics of darkness," he said.
On Mr Odinga's withdrawal from the repeat poll, President Kenyatta addressed him directly: "You cannot choose the opportunity to exercise a right and thereafter abscond from the consequences of that choice."
He revealed that he had not signed the Election Laws (Amendment) Bill, 2017 passed by Parliament days to the repeat election.
He said that given that a majority of the people who voted for him in August (appear to have) voted for him last Thursday, the repeat poll was a validation of his earlier victory.
Anybody planning to challenge his re-election must file their case at the Supreme Court within the next seven days, after which the court would have 14 days to hear and determine it.
The IEBC declared the result of the repeat poll with a zero return from Homa Bay and Siaya counties and a small percentage of votes from Kisumu and Migori, many parts of which were rocked by violence that made it impossible for the commission to conduct the election there.
As he announced the results, Mr Chebukati said that since he made his statement about two weeks ago stating the conditions required to ensure the election is free, fair and credible, enough measures had been taken to improve the conditions.
He said the commission had ensured that everything required of it by law had been done, including recruiting and training staff and identifying and gazetting polling stations.
Other measures include installing each Kiems kits with a Safaricom SIM card to speed up transmission of results, inviting parties to send ICT agents to monitor the process, training officers on how to use printers, satellite technology and to follow procedures to the letter.
"These elections have been run by a fresh team made of commission staff from all over the country," he said, giving details about what they had done differently to avoid the pitfalls of the August 8 election and adhere to the Supreme Court judgment.
"We ensured that the national returning officer would only announce results after receiving all forms 34A and signing the handover of the Forms 34B," Mr Chebukati said.