Representatives from rival parties were required to approve the forms before they were scanned and electronically transmitted to a national tallying center in Nairobi, where they were to be put online immediately so that they could be crosschecked.

But the electronic system, which had been overseen by an election official, who was killed on the eve of the vote, broke down. Therefore, only the results, and not the forms, were sent to the tallying center, often by text message.

The official results were based on the electronic tally, which was vulnerable to error, before the paper results were fully collated, the judges found.

In its findings earlier this month, the court also ruled that hundreds of polling stations had failed to send any presidential results; that some forms lacked security features like water marks, signatures or serial numbers; and that some unauthorized users had tried to access the voting system.

International election observers — including John Kerry, the former United States secretary of state — were quick to praise the electoral body immediately after the vote, saying there was no evidence of vote tampering at polling stations and that the paper forms would show clearly who had won. The observers had assumed that the forms would be easily verifiable and would be matched with figures texted to the tallying center by party officials.

Kenya has been mired in political uncertainty since the election, and there are renewed fears of violence, even though the vote took place peacefully and there were far fewer deaths in its aftermath compared with previous polls.