Officials from Mr Odinga's Coalition for Reforms and Democracy (Cord) alliance filed the suit at Nairobi's Supreme Court on Saturday. It came a week after the electoral commission declared Mr Kenyatta president-elect in a vote that Mr Odinga rejected as "tainted".

The petition questions both the conduct of the March 4 election and the tallying process, as well as the integrity of a final voter register.

"I am not challenging the outcome of the results because I want to be declared President, but rather let the will of the people prevail," Mr Odinga, Kenya's outgoing prime minister, said on Saturday. "These failures dwarf anything Kenyans have ever witnessed in any previous election."

Earlier in the day, police fired tear gas to disperse supporters of Mr Odinga gathered outside the court, wounding at least one. But the three-time presidential challenger called on his backers to remain calm.

If the petition is upheld, the court could call for a rerun of the presidential election.

Mr Kenyatta, who is facing charges of crimes against humanity at the International Criminal Court for his alleged role in post-election violence in 2007-08, edged across the 50 percent threshold, and avoided a run-off, by just over 8,400 votes.

The highly anticipated election was the first since disputes over a 2007 poll descended into violence, largely along ethnic lines, which left more than 1,000 dead and at least 350,000 displaced.

Millions turned out across the country on March 4 to cast their vote in a ballot that was mostly peaceful and praised by both domestic and international observers.

But the tallying process was marred by the rapid breakdown of an electronic results transmission system that has been designed to cross-check the manual vote count and protect against manipulation.

While the electoral commission acknowledged that errors had crept into some of the tallies, Mr Hassan assured the public that the results were "credible".

He declared Mr Kenyatta victor on March 9, following nearly five tense days of counting.

Just over an hour after the results were announced, Mr Odinga alleged "rampant illegality" in the electoral process and vowed to challenge the result in court.

A legal team for Mr Odinga, who came second in the disputed 2007 election and became prime minister through a power-sharing deal brokered by the international community to bring an end to the violence, took the full seven days permitted to assemble the case.

Cord lawyers sought documents from the IEBC and leading Kenyan communications company Safaricom, which supplied the mobile handsets and some network services used by the system, as they built their case.

"We are prepared in every way, we have a strong case," James Orengo, a senior Cord official and representative of Mr Odinga, told local media at the court. "Expect a new election, and this time around no monkey-business."

The pressure will now be on Kenya's Chief Justice, Willy Mutunga, who was appointed in 2011 and has spearheaded reforms to a judiciary that was widely seen as corrupt and partial.

Mr Mutunga earlier this week promised that the court would handle any challenge in a fair and speedy manner. It has up to two weeks to hear the case.

A civil society organisation, the African Centre for Open Governance (AfriCog), filed a separate petition contesting the integrity of the vote count.

Mr Kenyatta, son of Kenya's founding president and one of Africa's richest men, said he would accept the ruling of the Supreme Court and if necessary go back to the electorate.