Umaru Yar'Adua has been sworn in as Nigeria's new president at a colourful ceremony in the capital, Abuja.
Umaru Yar'Adua will have to prove his independence
Standing on a podium in a parade ground dressed in a white gown, Mr Yar'Adua was cheered by his supporters after he signed the oath of office.
The inauguration marks the first time in Nigeria's history that one civilian leader has taken over from another.
But his election was widely condemned as "not credible" and small protests were held in the largest city, Lagos.
"I, Umaru Musa Yar'Adua, do solemnly swear that I will be faithful and hold allegiance to the Federal Republic of Nigeria... That I will protect and defend the constitution," said Mr Yar'Adua, taking the oath from Chief Justice Idris Kutigi.
A few minutes previously, Goodluck Jonathan, from the troubled oil-producing Niger Delta region, was sworn in as vice-president.
Nigeria's 36 state governors have also taken their oaths of office around the country.
'Democracy is dead'
Security was tight in both Abuja and Lagos, with police setting up roadblocks.
In Lagos, the BBC's Umar Elleman says hundreds of protesters marched from Ikeja to the Yaba area, watched closely by security forces.
The protesters, led by activist Tunji Braithwaite, said they were mourning the death of democracy in Nigeria.
"Democracy is dead in Nigeria. So, we have come out on the streets to bury democracy," protester Justin Jalingo told the BBC.
Five of the protesters were arrested as they carried a mock coffin of outgoing President Olusegun Obasanjo.
In Abuja, Mr Obasanjo was driven into Eagle Square for the ceremony in an open jeep, waving to spectators in the reviewing stands.
Anglican bishop Peter Akinola gave an opening prayer before military bands and Nigerian soldiers in dress uniforms performed a slow march around the square.
The crowd, containing several African leaders and foreign diplomats, was also entertained by a troupe of synchronised dancers and police motorcycle stunt riders.
The BBC's Alex Last in Abuja says President Yar'Adua will have to prove his independence from Mr Obasanjo, who picked his successor and remains chairman of the ruling People's Democratic Party (PDP).
He adds that Mr Yar'Adua inherits many challenges in Africa's most populous country and largest oil producer.
Armstrong Adejo, a university teacher in Makurdi, Benue State in central Nigeria told the BBC: "I pray that God can transform him from a man with a questionable mandate into the leader we all crave."
A two-day strike called by trade unions in protest at alleged electoral fraud has so far received a muted response.
Most Nigerians still live in crushing poverty
After many years of military rule, Mr Obasanjo was elected president in 1999 and served two four-year terms.
In his farewell address on Monday evening, Mr Obasanjo pledged his support for Mr Yar'Adua and his government, and said he was leaving the country with a strengthened democracy.
"We have run the longest democratic dispensation and eliminated the risk of violent changes of government through coups and counter-coups in our political culture," Mr Obasanjo said.
The election commission, Inec, has denied charges that it favoured the PDP during last month's elections.
Mr Yar'Adua won a landslide victory in those polls, according to official results. He has promised to introduce electoral reforms.
The two main opposition candidates have challenged the results in court.