Raila Odinga, Kenya's defeated presidential contender, has filed a challenge to his election defeat.
As the incumbent prime minister submitted the petition in the capital Nairobi on Saturday, police fired teargas to disperse his supporters who had gathered in front of the Supreme Court where the decision will be made.
Lawyers for Odinga called their petition a "legitimate legal process" that ensures the will of the people is respected.
Odinga refuses to accept the slim first-round win by his opponent Uhuru Kenyatta, alleging collusion between the president-elect and the electoral commission.
Al Jazeera’s Nazanine Moshiri, reporting from Nairobi, said the Supreme Court has two weeks to decide to uphold the decision of Kenyatta as president or to have a runoff.
"Odinga regrets that five years ago, when he felt the election was stolen from him, there was no process for him to identify those responsible for election crimes," she said.
Meanwhile, a public prayer service to pray for a peaceful outcome to the disputed election result on Sunday has been canceled. Police revoked the public gathering license for the Uhuru Park event slated to be attended by Kenyatta and William Ruto, his deputy.
At least one person was wounded on Saturday as police quickly cleared the crowd from the front of the court building.
Some of the supporters wore T-shirts marked with slogans "I support the petition" and "Democracy on trial", an echo of Odinga's statement that his petition would be a test of democracy in Kenya.
"We are dealing with criminals who should not be in State House but in prison," Odinga said earlier this week of his opponents.
|Follow our in-depth spotlight coverage of the vote
Police hurled tear gas at the crowd, who pulled back before surging forward to within 50 metres of the Supreme Court's gates.
Describing the situation outside the court as calm after the petition was filed, Al Jazeera's Moshiri said: "The feeling outside the court among Odinga's supporters is not violent. Odinga has been telling his supporters to wait for the results of the court decision - they can voice their opinions in the streets but it should not turn into a situation like 2007."
Both Kenyatta and the electoral commission deny colluding to rig the election.
Kenya's March 4 election was the first since disputes over a 2007 poll triggered tribal clashes in which more than 1,200 people were killed.
Unlike the bloody violence that scarred the country five years ago, this time the fighting is largely online.
Kenyatta, the son of Kenya's first president and one of Africa's richest men, was declared the winner of the presidential poll on March 9.
He is due to go on trial for crimes against humanity at the International Criminal Court (ICC) in The Hague in July for his alleged role in orchestrating the violence.
The ICC said it would pursue Kenyatta's case despite the fact that charges against Francis Muthaura, the former head of Civil Service, were dropped on March 11.
The president-elect just avoided a second-round runoff vote to win a majority with 50.07 percent to beat his closest rival, Odinga, by more than 800,000 votes.