President Mwai Kibaki took the oath of office Sunday minutes after being declared the winner of a vote marred by allegations of rigging, as black smoke billowed from the impoverished slum home to thousands of rioting opposition supporters.

Elections chief Samuel Kivuitu, who read the results on live television after other media were expelled from the main vote headquarters, said Kibaki beat Raila Odinga by 231,728 votes in the closest race in Kenya's history.

• Click here to view photos.

"This means Honorable Mwai Kibaki is the winner," Kivuitu said.

Within minutes, black smoke rose above Nairobi's sprawling Kibera slum, where thousands of people have been on the streets for the past two days shouting "Kibaki must go!" and claiming the vote was rigged. Violence around the country has killed at least 15 people since Saturday, authorities said.

"These are our guns," said 24-year-old Cliff Owino, holding up a handful of rocks in Mathare, a Nairobi slum where young men were setting up roadblocks and building bonfires. "But a voting card is our atomic weapon."

Others were waving machetes in the air as buses and shops burned.

Kibaki was sworn in shortly at State House shortly after the results were announced.

"We have done our nation proud and set a good example for the rest of the continent," he said.

Earlier Sunday, Odinga called on Kibaki to concede and demanded a recount, saying the electoral commission "cannot possibly address the multiple levels of fraud administered by this administration."

But Kibaki's camp urged patience for the official results, and accused Odinga's Orange Democratic Movement of being behind the violence. "ODM is responsible for all the incitement that is taking place right now," said Danson Mungatana, an official with Kibaki's Party of National Unity.

The disputed campaign comes in one of the most developed countries in Africa, with a booming tourism industry and one of the continent's highest growth rates. Many observers saw the campaign as perhaps the greatest test yet of this young, multiparty democracy and raised grave concerns as the process descended into violence.

Alexander Graf Lambsdorff, chief European Union election monitor, said the Electoral Commission of Kenya "has not succeeded in establishing the credibility of the tallying process to the satisfaction of all parties and candidates."

Kivuitu, the electoral commission chairman, acknowledged problems, including a constituency where voter turnout added up to 115 percent and another where a candidate ran away with ballot papers.

Supporters of 76-year-old Kibaki say he has turned Kenya's moribund economy into an east African powerhouse, with an average growth rate of 5 percent.

He won by a landslide in 2002, ending 24 years in power by the notoriously corrupt Daniel arap Moi, who was constitutionally barred from extending his term.

But Kibaki's anti-graft campaign has largely been seen as a failure, and the country still struggles with tribalism and poverty. After the opposition took most of the parliamentary seats, he may find it difficult to rule even if he wins.

Odinga, a fiery 62-year-old former political prisoner, promised change and help for the poor. His main constituency is Kibera, home to at least 700,000 people who live in extreme poverty and the scene of many of Saturday's riots.

In recent months he has made it a priority to reach out to the country's middle class and businessmen, many of whom belong to Kibaki's tribe, the Kikuyu. Odinga belongs to the Luo tribe.