Kenya's defeated presidential contender Raila Odinga filed a legal challenge to his election loss on Saturday in a major test of the country's democracy five years after a disputed vote triggered deadly tribal violence.
Shortly before, police outside the Supreme Court used teargas to break up a rally of around 100 Odinga supporters, who were urged by the outgoing prime minister to stay calm and trust in the law to resolve his complaint.
Odinga's petition threatens to extend the period of uncertainty shadowing east Africa's largest economy.
The outgoing prime minister refuses to accept the slim first-round election win by Uhuru Kenyatta, who has been indicted by the International Criminal Court over the 2007 bloodletting in which more than 1,200 people were killed.
The March 4 vote was largely peaceful by contrast, and Kenyatta declared it "free and fair" in his acceptance speech last Saturday, though he added that the electoral process could be made more refined and efficient in the future.
Kenya's electoral commission (IEBC) had promised a smooth election but the collapse of an expensive new electronic voting system led to a five-day wait for the winner to be announced.
Odinga's petition alleges widespread rigging and accuses the IEBC of inflating voter registration numbers and going ahead with the election aware that its systems were going to fail.
"These failures dwarf anything Kenyans have ever witnessed in any previous election," Odinga told reporters on the doorstep of his office in the centre of the capital Nairobi.
"Every mechanism and every instrument the IEBC deployed failed miserably. Its failure and collapse, on a catastrophic scale on the polling day, so fundamentally changed the system of polling and the number of votes cast."
Kenyatta comfortably beat Odinga in terms of votes won, 50.07 per cent versus 43.28 per cent, but only narrowly avoided a run-off after winning just 8,100 votes more than the 50 per cent needed to be declared the winner outright.
The tight nature of Kenyatta's win has given Odinga allies confidence that they can force a run-off through the courts, though the petition calls for the whole process to be declared null and void.
By the time the petition was filed in the early afternoon, hundreds of Odinga supporters gathered outside the court, many wearing T-shirts with slogans such as "democracy on trial".
"I am not happy with the election results, since my rights have been stolen. President-elect Uhuru Kenyatta is not my choice," Florence Bolo, an Odinga supporter, said outside the Supreme Court. Others shouted: "Uhuru must go!"
"We Kenyans want justice and I am crying for the Supreme Court to look at this case as critical and come out with a fair judgement," said Hamsa Omondi, a 21-year-old street vendor.
Traffic was moving freely through Nairobi and there were no signs of further unrest in the capital.
Many had feared a repeat of the 2007 violence after this month's vote, and were relieved when that did not transpire.
But analysts say a swift, transparent resolution of the dispute will be critical to restoring Kenya's reputation as a stable democracy. Big Western donors worry about a nation seen as a vital ally in the regional fight against militant Islam.
Kenya's stock market, which surged 7 per cent in the two days after the peaceful conclusion of the March 4 vote, then suffered three consecutive days of falls. Traders said the Supreme Court petition had unnerved foreign investors.
The IEBC has consistently described the vote as credible despite a series of technological glitches on voting day and during the tallying of ballots. The IEBC spokeswoman could not be reached for comment.
International monitors, commenting shortly after counting began, said the election was broadly credible up to that point. But the count went for five days, and monitors did not follow the entire count process, diplomats say.
Odinga's petition names four respondents – the IEBC, its chairman Issack Hassan, Kenyatta and his running mate William Ruto, who is also under ICC indictment for crimes against humanity over the 2007 bloodshed. Both deny the charges.
Odinga's attempts to nullify Kenyatta's victory will be the first significant test for Kenya's new Supreme Court, established under a constitution adopted in a 2010 referendum.
Chief Justice Willy Mutunga, appointed in 2011 to reform a legal system accused of serving the interests of the elite, will be under pressure to deliver a transparent verdict in a country where political tensions are more tribal than ideological.
Mutunga received death threats in the run-up to the vote but promised the judiciary would act without "favour, prejudice or bias" when handling election complaints. He invited the media to cover the proceedings live from the court.
Odinga's decision to contest the election outcome in the courts was a major departure from his response to the 2007 election outcome which he also described as rigged.
Odinga at the time summoned supporters out into the streets for peaceful protests, as he did not trust the judiciary to be fair. But violence quickly erupted between tribes backing competing leadership candidates and spread across Kenya.