As riots spread, the Kenyan government suspended all live radio and television news reports.
Andrew Simmons, Al Jazeera's Africa bureau chief in Nairobi, said that President Kibaki was cracking down hard on any resistance to the election result.
"The situation now is that there are riots going on all around the country.
"Right now, the alert, we fear, could turn into a state of emergency ... All the symptoms are there," he said.
Taking the oath of office, Kibaki called for national reconciliation and pledged to form a corruption-free "clean hands" government.
"I urge all of us to set aside the divisive views we held during the campaign period and embrace one another as brothers and sisters. After all, we belong to one family called Kenya," he said.
Samuel Kivuitu, the chairman of the electoral commission, said Kibaki won with 4,584,721 votes against Odinga's 4,352,993 votes.
Odinga walked out of the news conference addressed by Kivuitu.
|Odinga says President Kibaki has |
stolen the vote [AFP]
The opposition has since then rejected the results. It said it was planning its own alternative inauguration ceremony of its leader and "people's president" Odinga at Nairobi's Uhuru Park.
"We are inviting Kenyans to Uhuru Park, Monday the 31st of December, 2007, at 2pm for the presentation to the nation of the People's President, elected Honourable Raila Amolo Odinga," the Orange Democratic Movement (ODM) said in a statement.
The European Union's team of election observers said the country's electoral commission had failed to ensure the credibility of the presidential vote.
"We believe that, at this time, the ECK (Electoral Commission of Kenya), despite the best efforts of its chairman, has not succeeded in establishing the credibility of the tallying process to the satisfaction of all parties and candidates," Alexander Graf Lambsdorff, the chief EU observer, said in a statement.
Chanting "No peace, No peace", protesters took to the streets of Kibera, Kenya's largest slum with a population of more than one million people, minutes after Kivuitu announced Odinga's defeat.
A police helicopter circled the slum while riot police, already deployed around the neighbourhood, fired live rounds into the air.
In an announcement on public television, shortly after being prevented from giving a full round-up of the official results by heckling opposition supporters, Kivuitu said: "These results are not the end of the world for the losers, there is tomorrow."
Odinga, 62, and once Kibaki's cabinet colleague, led the president in most pre-election opinion polls and in the early media tallies of the general elections held on Thursday.
The challenger's party had unilaterally declared victory on Saturday. Earlier on Sunday, Odinga reiterated his call for Kibaki to concede defeat and demanded a national recount.
It was not immediately clear if Odinga would seek to mount a legal challenge.
Observers pointed out that an announcement by the electoral commission would be very difficult to reverse.
On Saturday, hundreds of opposition supporters faced off with riot police in the sprawling Kibera slum, shouting "No Raila, No Kenya!" and "We want our rights!"
Kibaki campaigned on the strong growth Kenya experienced during his five years in office while Odinga has argued that few Kenyans have reaped the benefits of the country's economic successes.