Kenya's opposition demanded Thursday that its candidate Raila Odinga be declared president, rejecting results that showed him trailing incumbent Uhuru Kenyatta in a fraught election that has sent jitters through the east African nation.

Celebrations erupted in opposition strongholds that have also seen angry protests over Odinga's rigging claims, which sparked a gloomy sense of deja vu in a country that witnessed disputed polls in 2007 and 2013.

Britain and the US joined foreign observer missions from the European Union, African Union, Commonwealth and the Carter Center in urging party leaders to be patient and refrain from inflaming tensions ahead of the release of final results, expected Friday.

But the opposition National Super Alliance (NASA) doubled down on accusations the counting process was a "sham" after Odinga claimed Wednesday that hackers broke into the electronic tallying system and manipulated results.

One of NASA's leaders Musalia Mudavadi provided documents purportedly obtained from the servers of the electoral commission (IEBC) via a "confidential source" showing that Odinga had 8.04 million votes, leading Kenyatta on 7.75 million.

This was despite the fact that results streaming onto the IEBC website showed Kenyatta with 8.1 million votes to Odinga's 6.7 million.

"We demand that the IEBC chairperson announce the presidential election results forthwith and declare Raila Amolo Odinga... as the duly elected president," said Mudavadi.

IEBC chief Wafula Chebukati rejected this demand, saying the commission would only announce final results once all the forms from constituencies had arrived at the tallying centre in Nairobi and been validated -- expected by midday Friday.

In his response to NASA he detailed that the printout was riddled with arithmetic errors and came from a Microsoft database, while the IEBC's system was running on Oracle.

- 'Needless anxiety' -

While veteran opposition leader Odinga, 72, claimed 2013 polls were stolen from him, he took his grievances to the courts and ended up accepting his loss.

But in 2007-2008, in a poll observers said was riddled with irregularities, his loss prompted an eruption of ethno-political violence, leaving 1,100 dead and 600,000 displaced.

"We do not want to see any violence in Kenya. We know the consequences of what happened in 2008 and we don't want to see a repeat of that," Odinga told CNN in an interview.

However he repeated his assertion that "I don't control anybody. People want to see justice."

In the Kondele neighbourhood of the western city of Kisumu -- where protests erupted on Wednesday -- hundreds of celebrating Odinga supporters took to the streets, banging drums and blowing vuvuzelas after Mudavadi's announcement.

"We are happy," said 35-year-old Anthony Karaba, as a police helicopter hovered overhead.

"We need peace and we need the correct results."

In Nairobi's Mathare slum, where the capital's police chief said officers shot dead two men who had allegedly attacked them with machetes on Wednesday, scores of people streamed through the streets shouting "Uhuru must go".

On Thursday many businesses remained closed and the streets were very quiet in the capital and elsewhere.

The IEBC insists its electronic voting system -- seen as key to avoiding fraud -- had not been compromised, despite apparent attempts to do so.

"Hacking was attempted but did not succeed, that is our position," said Chebukati.

US state department spokeswoman Heather Nauert urged "all parties and their supporters to peacefully and patiently await the IEBC's announcement of official results.

The UK minister for Africa, Rory Stewart, said candidates in the former British colony should "refrain from any actions or statements which could heighten tensions whilst the country awaits the vote outcome."

Earlier former US secretary of state John Kerry, leading an observer team from the Carter Center, expressed confidence in the integrity of the electronic system.

"We believe the IEBC put in place a detailed, transparent process of voting, counting, reporting and securing the vote, all of which lends significant credibility and accountability," Kerry told journalists.

Some 400 international observers were present for Tuesday's vote.

Marietje Schaake, head of the EU mission, said IEBC officials were "working around the clock. It's important they have the time to do these procedures well."