Kenyan opposition leader Raila Odinga, who is contesting his loss in this month's presidential election in the Supreme Court, said he will respect the court's ruling - but still believes he won.

This is Odinga's fifth run at the presidency, blaming previous losses on rigging, claims that have twice sparked deadly protests in East Africa's wealthiest and most stable nation.

A week ago, Odinga's legal team lodged a case alleging that a team working for Deputy President William Ruto hacked into the election system and replaced genuine pictures of polling station result forms with fake ones, thus increasing Ruto's share of the Aug. 9 vote.

Ruto, who was declared president-elect, denied the allegations. The election commission has split and filed competing responses - four commissioners disowned the result, and the chairman and two others supported it.

The Supreme Court must rule by Sept. 5.

The dispute has raised fears of violence similar to that which followed disputed polls in 2007 when more than 1,200 people were killed and again in 2017 when more than 100 people died.

Odinga said he had proof that he had won the election, which requires a candidate to receive 50% of the vote plus one. He wants a recount.

"We should be announced as the winners," Odinga told Reuters. However, he added: "if the courts decide otherwise, we will basically respect the ruling of the courts."

When asked if there were any circumstances under which he would not accept the ruling, he said:

"I don't really want to appear as if I'm trying to blackmail the Supreme Court. I want the Supreme Court to hear this case impartially ...I don't want to speculate."

Any unrest in Kenya ripples out to the wider region. Kenya is a key transport hub, the regional headquarters for many multinationals, and has often hosted talks for more volatile neighbours like South Sudan and Somalia.

Odinga's petition also alleged that the result was invalid because it was announced by the chairman instead of the whole commission. Odinga said he wanted the chairman replaced.

He said Kenya had been captured by "corrupt cartels" and that he would dedicate his future political life - whether in the government or opposition - to fighting corruption by demanding lifestyle audits for officials and examining procurement contracts.

Ruto's legal response accused Odinga's suit of being "full of sound and fury" and "much ado about nothing". He accused Odinga of falsifying computer logs to create a constitutional crisis and force a power-sharing agreement.

The chairman of the election commission has said that the elections were "free, fair and credible" in his court response. The dissident commissioners have filed a response raising concerns over the tallying process and the conduct of the chairman.

(Refiles with new story identifying tag to match pictures. No change to text)