William Ruto was sworn in as Kenya's president on Tuesday after narrowly winning the Aug. 9 election in East Africa’s most stable democracy.

The Supreme Court last week rejected a challenge by losing candidate and longtime opposition figure Raila Odinga to the official results.

The 55-year-old Ruto had been the deputy to outgoing President Uhuru Kenyatta but had a bitter split with Kenyatta that left the two not speaking for months at a time.

On Tuesday, the audience cheered as the two shook hands, and again as Kenyatta handed over the instruments of power.

ETHIOPIAN AIRSTRIKE HITS KINDERGARTEN IN TIGRAY REGION LEAVING SEVERAL DEAD, INCLUDING CHILDREN

The event began with some chaos. Scores of people were crushed and injured as they forced their way into the packed stadium. A medic said a fence fell down after people pushed it and about 60 were injured, though the number may rise.

"We had to treat some with minor injuries. Most of them were rushed to the main hospital in Nairobi," Peter Muiruri said. There were no reports of deaths.

William Ruto, on left, laughs while wearing a dark suit and yellow tie while Rigathi Gachagua, right, also laughs while wearing a dark suit

Kenya's President-Elect William Ruto, left, jokes with Deputy President-Elect Rigathi Gachagua, right, as he addresses the media at his official residence in Nairobi, Kenya Monday, Sept. 5, 2022. (AP Photo/Brian Inganga)

People tried to dodge baton-wielding security forces. Some failed. "I was beaten by the police after trying to get inside," said one witness, Benson Kimutai.

Ruto is taking power in a country heavily burdened by debt that will challenge his efforts to fulfill sweeping campaign promises made to Kenya’s poor.

GUNMEN STORM HOTEL IN SOMALI CAPITAL, LEAVE 20 DEAD

With the transition, Kenya’s presidency moves from one leader indicted by the International Criminal Court to another. Both Kenyatta and Ruto were indicted over their roles in deadly 2007 post-election violence, but the cases were later closed amid allegations of witness intimidation.

A woman wearing a red scarf holds her leg in pain while military officers walk around her

A woman lies on the floor after being crushed in a stampede when security forces kept others back, after they forced their way into Kasarani stadium where the inauguration of Kenya's new president William Ruto is due to take place later today, in Nairobi, Kenya Tuesday, Sept. 13, 2022.  (AP Photo/Brian Inganga)

The August election was peaceful in a country with a history of political violence. Chaos erupted only in the final minutes when the electoral commission publicly split and prominent Odinga supporters tried to physically stop the declaration of Ruto as the winner.

AT LEAST 5 KILLED AS ANTI-UN PROTESTS FLARE IN EAST CONGO

Ruto’s campaign had portrayed him as a "hustler" with a humble background of going barefoot and selling chickens by the roadside, a counterpoint to the political dynasties represented by Kenyatta and Odinga. But Ruto received powerful political mentoring as a young man from former President Daniel arap Moi, who oversaw a one-party state for years before Kenyans successfully pushed for multiparty elections.

A crowd of people walk over each other behind bars

People are crushed in a stampede as security forces attempt to push them back, as they force their way into Kasarani stadium where the inauguration of Kenya's new president William Ruto is due to take place later today, in Nairobi, Kenya Tuesday, Sept. 13, 2022.  (AP Photo/Brian Inganga)

Ruto now speaks of democracy and has vowed there will be no retaliation against dissenting voices.

The losing candidate, the 77-year-old Odinga, is setting himself up to be a prominent one. In a statement on Monday, he said he would skip the inauguration and later will "announce next steps as we seek to deepen and strengthen our democracy."

CLICK HERE TO GET THE FOX NEWS APP

Though Odinga also asserted that "the outcome of the election remains indeterminate," a spokesman told The Associated Press it was "highly unlikely" he would seek to declare himself the "people’s president" as he did after losing the 2017 election.