The east African nation, keenly aware of post-poll violence a decade ago that left 1,100 dead, was on a knife-edge after a day of isolated protests in opposition strongholds.
The unrest broke out after opposition leader Raila Odinga claimed massive fraud as Kenyatta surged ahead in provisional results, with 54 percent compared to his 44.7 percent. Results from over 96 percent of polling stations were in.
Two protesters were shot dead in the flashpoint slum of Mathare in Nairobi, where police also fired tear gas at crowds who burned tyres and blocked roads throughout the day.
An AFP photographer saw one of the victims, a young man with a massive gunshot wound to the head.
Nairobi police chief Japheth Koome said the two who were killed had tried to “attack our officers with pangas (machetes) and that’s when the officers opened fire on them.”
In the southeastern Tana River region, police said five men armed with knives had attacked a vote tallying station and stabbed one person.
“Our officers killed two of them and we are looking for others who escaped,” said regional police chief Larry Kieng.
“We have not established the motive yet, we don’t know if it is political or if it’s a criminal incident but we are investigating and action will be taken.”
The region is prone to attacks by Al-Qaeda linked Shabaab militants.
RELATEDHacking attack denied
Decrying a “sham” tallying process, Odinga detailed accusations of a major attack on the electronic voting system, saying hackers had gained entry using the identity of top IT official Chris Msando, who was found tortured and murdered late last month.
“This is an attack on our democracy. The 2017 general election was a fraud,” said Odinga, claiming detailed evidence of the hackers’ movements.
The 72-year-old, who is making his fourth bid for the presidency as the flagbearer for the National Super Alliance (NASA) coalition, accused his rivals of stealing victory from him through rigging in 2007 and in 2013.
“You can only cheat a people for so long,” he said.
Election commission (IEBC) chief Ezra Chiloba denied that the crucial electronic system — seen as key to avoiding fraud — had been compromised.
“Our election management system is secure. There was no external or internal interference to the system at any point before, during or after the voting,” he told a press conference.
Odinga’s claims led to isolated protests in his stronghold in the western city of Kisumu as well as in slums in Nairobi.
Responding to the tensions, former US secretary of state John Kerry, an observer with the Carter Centre, expressed confidence in the electronic voting system and urged Kenyans “not to jump to conclusions”.
“It is also going to be critical to the leaders of Kenya to step up and lead in the next days to give people confidence that this process is being worked carefully, thoughtfully and respectfully.”
0:00 Kenyatta ahead as votes counted Share Kenyatta ahead as votes counted
Calls for calm
Aside from the alleged hacking, the opposition’s main complaint was that results streaming in electronically had yet to be backed up by a scanned copy of the results from constituencies.
Chiloba assured that these forms were coming in and that candidates’ teams were being given access to them. The IEBC has insisted the results on its public website should not be considered final until they have been cross-checked.
Raphael Tuju, secretary-general of Kenyatta’s Jubilee party, urged the opposition to “look at the figures soberly” and accept the results.
Odinga urged his supporters to “remain calm as we look deep into this matter”.
But he added: “I don’t control the people.”
The heads of nine international observer missions released a joint statement calling on parties and their supporters to remain calm, and turn to the courts with their grievances.
“We appeal to all citizens of Kenya to remain committed to peace and the integrity of the electoral process,” read the statement.
The contest between Odinga and Kenyatta was seen by pollsters as too close to call ahead of the vote.
It is the second time the two men have faced off in a presidential election, a dynastic rivalry that has lasted more than half a century since their fathers Jomo Kenyatta and Jaramogi Odinga went from allies in the struggle for independence to bitter rivals.
Kenyatta, 55, is credited with overseeing steady economic growth of more than five percent. But food prices have soared under his watch, and several major corruption scandals broke out in his first term.