Odinga, a longtime opposition candidate and the son of Kenya’s first vice-president, unsuccessfully challenged the results of the 2013 vote. His supporters at first said they would not go to court again this time but filed a petition two weeks ago.
Human rights groups have said police killed at least 24 people in unrest that followed the vote on 8 August.
Kenya was braced for further protests on Friday and police were deployed to sensitive areas of the capital, Nairobi. Security was tight around the courthouse as the judges prepared to rule on the challenge.
“This day is the D-day. We are going to know who is the president and we are very confident that the supreme court is going to give us our president,” said one Nairobi resident, Felix Achieng, before the ruling.
Local newspapers declared Friday a “date with destiny.” Many shops in the capital remained closed.