William Ruto has been sworn in as Kenya's fifth president, a week after the Supreme Court upheld an election that dashed the hopes of the nation's most prominent political families and handed power to a man who began his career as a roadside chicken seller.

Mr Ruto will have to blunt the impact of the global surge in food and fuel prices for poor Kenyans, try to solve high unemployment and tackle the rising public debt that his predecessor Uhuru Kenyatta has used to finance development over the past 10 years.

By 5am, Nairobi's 60,000-seat Kasarani Sports Centre was packed with Mr Ruto's supporters resplendent in his party's colours of yellow and green. They danced and waved miniature national flags to the strains of a band.

"He is our fellow youth! I know he will bring us more opportunity," said dancer Juma Dominic as he and his troupe warmed up.

The National Police Service had tweeted that the stadium was full by 5am and asked citizens to stay home, but crowds continued to try to force their way inside. The St John's Ambulance Service said it had taken several injured people to hospital.

Mr Ruto has served as Mr Kenyatta's deputy since 2013, but they fell out after the last election. Mr Kenyatta had backed opposition leader Raila Odinga to succeed him and denounced Mr Ruto as unfit for office.

"Mr President-elect, as you walk the path to your inauguration and beyond, you will be president not just for those who voted for you but for all Kenyans," Mr Kenyatta said in an address last night, wishing Mr Ruto well.

Supporters of Kenyan President elect William Ruto celebrating on a street in Nairobi after his election

Mr Odinga had filed a court challenge accusing Mr Ruto of cheating his way to victory but the Supreme Court swept aside his petition alongside several others. It was the fifth time that Mr Odinga, aged 77, had stood for election.

"Democracy is expected to unite people, strengthen their society and improve its institutions and must not become an acrimonious, fearful and desperate enterprise," Mr Ruto tweeted after the ruling.

"Those who voted for me as well as those who voted for my competitors want the same thing for themselves and for their children."

Mr Ruto, a 55-year-old former roadside chicken seller who is now a wealthy businessman, portrayed himself as an underdog battling the elite during the campaigns, pointing out that Mr Odinga and Mr Kenyatta were the sons of the nation's first vice president and president respectively.

That message resonated with chronically underemployed youths and families squeezed by poverty and rampant corruption, which Mr Kenyatta publicly acknowledged that he was unable to rein in.

Kenya is a key Western ally in an unstable region, and East Africa's most wealthy and influential nation. It hosts the regional headquarters of many global companies and organisations.