Kenyan police maintained tight security on Sunday as calm returned after a court ruling upholding Uhuru Kenyatta's presidential election win sparked anger among his rival's supporters, leading to riots that left two people dead.
Outgoing prime minister Raila Odinga had challenged the result of the March 4 poll hoping for a rerun, but while he begrudgingly accepted the Supreme Court's decision on Saturday, youths in his strongholds were enraged.
Riots broke out immediately after the ruling, leaving two dead in the city of Kisumu, said Joseph Ole Tito, police chief for the western Nyanza region.
Sporadic clashes were also reported in Nairobi's Mathare slum on Sunday morning with police firing tear gas at youths who had pelted them with stones.
But calm had been restored by early afternoon as security forces maintained a strong presence in and around Mathare, home to many of Odinga's supporters.
Calm had also returned to western Kenya, another Odinga bastion, although many shops in the main city of Kisumu remained boarded up after Saturday's looting.
Emmanuel Owako, a local Red Cross coordinator said a total of 24 people in the western region had been admitted to hospital with injuries after the rioting and about 15 of them had gunshot wounds.
The vast majority had been discharged by Sunday.
There were few cars on the roads with residents preferring to walk to and from church on Sunday after several vehicles were damaged Saturday by stone-throwing youths.
"In Kisumu ... the situation has been contained and business is resuming to normal," Kenya's police chief David Kimaiyo told AFP.
"We have an adequate number of police officers in all parts of the country including in those troubled areas," he said.
The gunshots that had rung out sporadically for much of Saturday evening in Kisumu died down around midnight, residents said.
There were no reports of casualties in Nairobi where Odinga supporters had lit bonfires and tried to block roads in some slum areas on Saturday.
The six judges of Kenya's top court dashed Odinga's last hopes of victory by unanimously ruling that the March 4 election had been fair and credible and that Kenyatta and his running mate William Ruto had been "validly elected".
The ruling paves the way for Kenyatta, the son of Kenya's first president and one of Africa's richest men, to be sworn in as head of state on April 9.
Odinga, who argued that the ballot had been marred by widespread irregularities, said he accepted the court's ruling and wished his rival well.
"The court has now spoken," Odinga said, adding that while he might not agree with all its decisions his faith in the constitution "remains supreme".
The announcement of his defeat in the last elections in 2007, when he ran against outgoing president Mwai Kibaki, led to Kenya's worst violence since independence, with more than 1,100 dead and several hundred thousand forced to flee their homes.
Kenyatta for his part thanked his rival and said the court ruling was "a victory for all the Kenyans" who had turned out to vote.
The United States, Britain, France and the European Commission all congratulated Kenyatta on his victory.
Kenyatta and Ruto both face trial at the International Criminal Court in The Hague accused of crimes against humanity over their alleged role in planning the 2007-2008 post-election violence.
Kenyatta will become only the second sitting head of state, after Sudan's Omar al-Beshir, to face charges at the ICC.
Analysts have argued that, far from being a handicap, the international court case helped him by providing his camp with a victimisation narrative and keeping the campaign's focus away from his rivals.
Official results showed the president-elect won 50.07 percent of the votes -- just making it over the 50-percent threshold needed to avoid a second-round ballot by some 8,000 votes.