Shortly before the petition was filed, police outside the Supreme Court fired teargas to disperse a rally of around 100 Odinga backers. They were urged by the outgoing prime minister to stay calm and trust in the law. But Odinga's move threatens to prolong the period of uncertainty shadowing east Africa's largest economy.
Odinga refuses to accept the first-round election win by Uhuru Kenyatta, who has been indicted by the International Criminal Court over the bloodshed in 2007 that left more than 1200 people dead. Kenyatta beat Odinga 50.07% to 43.28%, avoiding a run-off by only 8100 votes.
Odinga's petition alleges widespread rigging and accuses the electoral commission of inflating voter registration numbers, and of going ahead with the election aware that its systems were going to fail. He said the failures "fundamentally changed the system of polling and the number of votes cast".