Rupiah Banda has promised to follow in the footsteps of his predecessor
Zambia's acting head of state, Rupiah Banda, has been sworn in as president, just two hours after officials said he had narrowly won Thursday's election.
According to final results, Mr Banda beat the main opposition candidate, Michael Sata, by 40.1% to 38.1%.
Earlier, Mr Sata rejected the result, saying a "bunch of thieves" had stolen the vote. His Patriotic Front said it would go to court to demand a recount.
But African regional electoral monitors said voting had been free and fair.
The governing Movement for Multiparty Democracy (MMD) said it recognised this was a moment of high emotion and tension, and urged all Zambians to calm down and work for unity and peace.
Rupiah Banda is sworn in as the new Zambian president
Security has been stepped up in the capital, Lusaka, amid fears of further unrest.
On Saturday evening, riot police fired tear gas at Mr Sata's supporters, who marched through a crowded Lusaka slum, setting fire to market stalls and throwing stones in the streets.
Mr Banda took over from President Levy Mwanawasa, who died in August having suffered a stroke a few months earlier.
The 71-year-old former diplomat and ex-vice-president has promised to follow in the footsteps of his predecessor.
Although Mr Mwanawasa reined in inflation and built up impressive foreign reserves, Zambia remains one of the world's poorest countries with more than 60% of the population living on less than $2 a day.
Mr Banda will serve until 2011, when Mr Mwanawasa's term would have ended.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.