Kenya's opposition has demanded that veteran leader Raila Odinga be declared winner of the presidential election, even though official counting of the ballots gives incumbent President Uhuru Kenyatta a commanding lead.

Musalia Mudavadi, a senior official in the opposition coalition, told reporters that information from "confidential sources" at the election commission showed Mr Odinga had secured victory by just under 300,000 votes, but provided no evidence.

Minutes later, hundreds of Odinga supporters, mainly young men, poured onto the streets of the opposition stronghold of Kisumu in celebration. At least one truck of anti-riot police followed them, a Reuters witness said.

Mr Odinga has said provisional results were "fictitious" and a product of a hacked system, but he has again put forward no evidence.

International observers have praised the handling of the election and the European Union mission said it had seen no sign of manipulation.

Earlier, the chairman of the election commission said it suffered a hacking attempt after Tuesday’s vote but the system was not compromised.

"Hacking was attempted but did not succeed," Wafula Chebukati told a news conference. He did not elaborate.

His comments contradicted an earlier statement by election commission head Ezra Chiloba who had said: "The (hacking) claims being made could not be substantiated from our end."

Mr Chiloba had told a news conference: "Our election management system is secure. There was no external interference to the system at any point before, during, and after voting."

The head of the European Union's election observer mission in Kenya said that it had seen no signs of "centralised or localised manipulation" of the voting process.

Marietje Schaake said that the EU mission's final report would evaluate the conduct of the tallying process, which opposition leader Raila Odinga said had been compromised by hackers.

Angry protests erupted in opposition strongholds in the capital Nairobi and the western city of Kisumu as the counting of votes from Tuesday's election continued, but the election commission said the election had been free and fair.

Police shot dead at least three people and protesters killed a fourth, witnesses said.

Although the violence remained largely contained, Kenyans were nervously hoping to avoid a repetition of the ethnic killings that followed a disputed 2007 presidential poll, when some 1,200 people died.

The latest provisional results from the election commission website put Mr Kenyatta in front with 54.3% of votes counted to 44.8% for Mr Odinga - a margin of 1.4 million ballots with 97% of polling stations reported.

Earlier Mr Odinga published his own party's assessment of the count on Twitter, saying he had 8.1 million votes against 7.2 million for Kenyatta. He provided no supporting documentation.

Mr Odinga had said hackers could have used the identity of a top election official, who was tortured and murdered days before the vote.

His statements raised concerns of unrest over the results in Kenya.

He posted 50 pages of computer logs online to support his hacking claims, but they were "inconclusive", according to Matt Bernhard, who studies computer security in election systems at the University of Michigan.

Some time stamps appeared out of order and it was hard to evaluate the veracity of screenshots without access to a server, he said.

Nr Odinga urged his supporters to remain calm but added: "I don't control the people". His deputy Kalonzo Musyoka said the opposition might call for unspecified "action" later.

In Nairobi police killed one demonstrator, and in Kisumu, an opposition stronghold, they fired teargas to scatter a group of 100 protesters. Unarmed men marched through the streets waving sticks and chanting "No Raila, no peace".

In coastal Tana River county, a gang wielding machetes attacked a tallying centre, killing one man and injuring ganother, said a community elder who witnessed the attack.

Police shot dead two attackers.

Foreign observer missions declined to comment on the hacking allegations but urged all parties to stay calm.