A bitterly divisive presidential election in Kenya descended into chaos on Wednesday after the opposition leader claimed that a government-sanctioned hacking attack had subverted the results to rob him of victory.
Police shot dead three protesters as violent clashes in the capital and elsewhere raised fears that the country could again be pitched into electoral violence after Raila Odinga accused Uhuru Kenyatta, the president, of resorting to "massive" fraud to secure re-election.
Mr Kenyatta, seeking a second and final five-year term, was on course for a convincing victory.
With nearly all the votes tallied, the president had secured 54.3 per cent of the vote against Mr Odinga's 44.8, according to provisional results released by the electoral commission - a much wider margin of victory than opinion polls had suggested.
Although the election appeared to have been the best-run in decades, Mr Odinga was quick to reject the result, claiming there had been a reprise of the rigging that probably cost him victory ten years ago.
"The electoral fraud and fabrication of results was massive," he said. "It has always been common knowledge that Uhuru Kenyatta's regime was a fraud. This takes Mr Kenyatta and [deputy president] William Ruto's fraud … to another level."
As groups of Mr Odinga's supporters gathered in the slums of the capital Nairobi and in his strongholds in western Kenya, some feared a return to the bloodshed that killed 1,300 people and forced 600,000 more following his defeat in 2007.
Opposition supporters in Nairobi's slums said they were awaiting an official declaration and further instructions from their candidate before taking action.
Kalonzo Musyoka, Mr Odinga's running mate, called on supporters to remain calm but he ominously hinted at the possibility of taking to the streets if the result was not overturned.
"There may come a time we may have to call you to action," he said.
Fury over the result was palpable in Nairobi's Kibera slum, one of Mr Odinga's strongest bastions in the capital, where many said they were willing to face death if President Kenyatta's victory was allowed to stand.
"We are running out of patience," said Jane Aoko, a teacher who had joined a growing gaggle of increasingly angry people gathered around a radio on one of the slum's fetid alleys.
"If you want peace you cannot keep making people angry. There can be no peace without justice."
The tension in Kibera was mirrored in other city slums inhabited by tribes supporting Mr Odinga's coalition, which largely represents ethnic groups that have never held power.
Since independence from Britain in 1963, the presidency has always been held by either the Kikuyu or the Kalenjin, the two tribes that dominate Mr Kenyatta's ruling party.
Many in Kibera spoke of deep-held resentments caused by half a century of perceived disenfranchisement, with some saying that only an uprising would redress a system seen as designed to enrich two tribes at the expense of the other 40.
"We have been oppressed so much," said Ayub Agutu, a Luo designer. "We are going to do a revolution once and for all to remove Uhuru Kenyatta."
But the president's fellow Kikuyus were angry that Mr Odinga, blamed by them for unleashing the bloodshed ten years ago, again appeared to be harnessing the street to challenge the outcome of the vote.
"If he has a problem he should go to court," said Moses Mijere, a driver in Kibera, advocating a course Mr Odinga has said he would not pursue after his bid to overturn the last election in 2013 was rejected by judges.
Amid the rising passions, the electoral commission attempted to defuse tensions by delaying the announcement of a final result, promising to investigate Mr Odinga's claims and inviting his agents to verify the results.
According to the opposition, the electoral commission's main database was hacked into and uploaded with an algorithm that added votes for Mr Kenyatta while taking them away from Mr Odinga.
"[The Hackers] arrogantly walked into the database, took control of the entire electoral process, manipulated data and published a facade for a result," Mr Odinga said.
The opposition leader refused to divulge how he had been able to expose the alleged fraud, saying he had to "protect" his sources.
Mr Kenyatta has yet to comment on the allegations, although the secretary-general of his ruling Jubilee Party accused Mr Odinga of causing "unnecessary drama".
There is as yet no evidence to support Mr Odinga's claims and foreign observers will not give their verdict until an official result is announced.
The murder late last month of the electoral official in charge of the electronic transmission of results - the very element the opposition says was manipulated - will also raise suspicions.
Mr Odinga alleged that the password of the dead man, Chris Msando, was used by the hackers to access the commission's chief server.