High-level representatives from the United States and United Kingdom Governments were also present.

"I, Olusegun Obasanjo, do solemnly swear that I will be faithful and bear true allegiance to the Federal Republic of Nigeria, and that I will preserve, protect and defend the constitution of the Federal Republic of Nigeria," he pledged to cheers and applause.

However, he warned that he did not have a "magic wand" to "put right in a few years the destruction of two decades".

Growing optimism

The courts this week rejected a request by opposition leader Muhammadu Buhari to postpone the inauguration.

Opposition groups say Obasanjo's victory is a fraud

International and Nigerian election monitors agreed there had been widespread irregularities during the vote, but none questioned the overall outcome.

For most of the time since independence, the country has been ruled by a series of military dictatorships.

In 1983, General Muhammadu Buhari, who came second to Mr Obasanjo in last month's poll, seized power just three months after the only other elections successfully organised by civilians.

But the BBC's Dan Isaacs in Abuja says there is a growing optimism that although this latest election process was marred in controversy, the democratic process is now firmly entrenched in Nigeria.