As U.S. Secretary of State John Kerry and a throng of African presidents and foreign diplomats looked on, the 72-year-old Mr. Buhari took the oath of office, two months after defeating the incumbent president, Goodluck Jonathan, in national elections.
Mr. Buhari’s swearing-in completes a first for Nigeria and represents a milestone for a continent still emerging from an era in which military rulers dominated the political scene. Mr. Jonathan is the first Nigerian president to lose a free-and-fair election then step aside peacefully.
“I will do right to all manner of people, according to law, without fear or favor,” said Mr. Buhari, sporting sunglasses and clad in an elegant white, three-piece robe as he recited the presidential oath.
With some of Africa’s remaining autocrats, including Zimbabwe’s President Robert Mugabe, in attendance, Mr. Buhari and Mr. Jonathan, both beaming, stood shoulder-to-shoulder on Friday.
“Together, we cooperated to surprise a world that had come to expect only the worst from Nigeria,” Nigeria’s new leader told some 6,000 people gathered in Eagle Square in the capital Abuja. Brass bands, two R&B singers and a gospel choir serenaded the guests, highlighted by a rendition of an old Nigerian pop tune, “Better Days Come.”
For many here, the prospect for a peaceful transition of power in Nigeria seemed dim months ago. Mr. Jonathan’s victory over Mr. Buhari in 2011 elections sparked days of religious riots that left more than 800 people dead.
Some expected March’s election to be marred by the same turmoil. Before the vote, former President Olusegun Obasanjo predicted Nigeria would slide into postelection violence as Ivory Coast did in 2011. Instead, Mr. Jonathan conceded the election swiftly, even before results of the voting were formally announced.
It isn’t Mr. Buhari’s first stint as Nigeria’s leader, having seized power in a military coup in 1983. But he takes over leadership of a country markedly different than the one he ruled for a mere 20 months before another army general deposed him.
Nigeria boasts Africa’s largest economy and is its largest oil producer, and in his inaugural address Mr. Buhari described the country’s rising importance on the world stage. He also said Nigeria was in a battle against terrorists, corruption and oil thieves.
He said he would step up the war against Boko Haram by moving more military commanders to the front, where they would be closer to the soldiers fighting the jihadist group. He also said he would push the army to commit fewer human-rights abuses.
A government program established in 2009 has made some headway in reducing the number of kidnappings and pipeline attacks that have marred Nigeria’s vital oil industry. In exchange for turning in their weapons and pledging to forsake violence, confessed oil bandits receive monthly payments.
Mr. Buhari said Friday he would invest heavily in the program before its scheduled expiration in December.
Most of the president’s remarks focused on the fight against corruption. He vowed to strengthen Nigeria’s courts and the prosecution of corrupt politicians. He also reassured the outgoing government that there would be no score-setting.
Nigerian politicians have a history of behaving “like spoiled children, breaking everything.” That had tainted an illustrious legacy, he said.
“We as Nigerians must remind ourselves that we are heirs to great civilizations,” he said. “We have an opportunity. Let us take it.”