The 72-year-old took the oath of office before the Chief Justice of Nigeria, Supreme Court President Mahmoud Mohammed, to begin a four-year term in which he faces difficulties from the outset.
"I, Muhammadu Buhari, do solemnly swear that I will be faithful and bear true allegiance to the Federal Republic of Nigeria," he said at the ceremony at Abuja's Eagle Square venue.
"That as President of the Federal Republic of Nigeria, I will discharge my duties to the best of my ability and in accordance with the constitution of the Federal Republic of Nigeria and the law."
Buhari's inauguration, before past Nigerian leaders and serving heads of state from across the continent, comes 32 years after he seized power in a military coup and was ousted 20 months later.
Also Read
Before taking the oath, he shook hands with the elected president he ousted in 1983, Shehu Shagari, and the general who deposed him, Ibrahim Babangida.
Buhari has described himself as a "converted democrat" and vowed to lead an administration committed to the needs of Nigeria's 173 million people by cracking down on the scourge of corruption.
But beyond the political challenges facing the new government, the historic importance of the ceremony should not be overlooked, said Clement Nwankwo, an activist who fought against military rule.
"The handover... Represents a significant milestone in the democratic development of Nigeria," Nwankwo, who now heads the Policy and Legal Advocacy Center, told AFP.
Civilian rule was restored in 1999 but the Peoples Democratic Party (PDP) has held power at the federal level for the last 16 years, at times appearing intent on staying on at any cost.