Abuja.Nigerian President Muhammadu Buhari was sworn in for a second term in office on Wednesday, vowing once more to tackle crippling security threats and root out corruption in Africa's key economy.
The 76-year old leader, in power since 2015 and re-elected in February, took the oath of office for a second four-year term in the capital Abuja.
"I do solemnly swear that I will be faithful and bear true allegiance to the Federal Republic of Nigeria," Buhari said, dressed in simple white robes and traditional embroidered cap. "I will preserve, protect and defend the constitution."
Buhari took the oath of office at what officials called a "low-key" ceremony.
It included a red-carpet arrival flanked by bagpipers with a military guard of honour and seating packed with dignitaries.
Vice President Yemi Osinbajo was also sworn into office.
Buhari was re-elected with 56 percent of the vote in Africa's most-populous nation -- and top oil producer -- after a delayed poll that angered voters.
- Opposition legal challenge -
His rival, Atiku Abubakar of the Peoples Democratic Party (PDP), who came second with 41 percent of the vote, has along with other opposition leaders launched an ongoing legal challenge to the victory.
They allege irregularities in the vote and have called it a "sham" result.
Buhari, a former army general who led a tough military government in the 1980s, campaigned on a promise to make the country safer.
He begins a final term beset with numerous challenges.
Nigeria is struggling from multiple conflicts, including an Islamist insurgency in the northeast of the country.
On Tuesday night, a large force of the Boko Haram jihadists attacked the northeastern city of Maidugari, but soldiers stopped them before they could enter, resulting in a night-long battle, according to security sources.
The fighters fled just before dawn on Wednesday, they said.
Buhari's time in power has also been dogged by questions about his medical fitness. He has spent several months abroad for treatment for an unspecified condition.
Buhari has touted himself as a "converted democrat" to persuade those with misgivings that his military past was history.
But in office he has struggled to shake off claims of authoritarianism -- particularly in his fight against corruption which critics say has been one-sided against perceived political opponents.
- Economic woes -
Buhari, who inspected the military parade in front of applauding spectators after watching the flag of Nigeria raised to the national anthem, made no speech.
But ahead of the inauguration he told state television in an interview of what he hoped to achieve next -- speaking how he wanted those stealing money from government to be "punished."
The economy has suffered difficult times in recent years.
"My frustration is that we cannot move faster in prosecution and punishment of corrupt persons," Buhari said late Monday.
"Even if you are using whistle blowers, you have to go to the police... to go through the rigmarole of full investigation before prosecution," he added.
His last term was held up by squabbles with lawmakers in the National Assembly, who, among other things, blocked the passing of last year's budget for several months.
He passed an ambitious budget for 2019 on Monday, although analysts criticised that as "unrealistic", saying figures were based on an over-estimation of available income amid volatile global crude prices.
- Bandits and kidnapping -
Analysts expect Buhari to follow the same agenda as his first term, but widening out efforts to claw back control of lawless regions.
Boko Haram attacks in the northeast are only one problem.
Criminal gangs of bandits carry out mass raids against villagers -- looting, stealing livestock and killing -- while kidnappers stage regularly take hostages for ransom.
A violent conflict between pastoralist herders and settled farmers has devastated large parts of the central "Middle Belt" of Nigeria.
"The focus on anti-corruption will remain top of the agenda, but is now more likely to zoom in on the judiciary and the police -- with the aim of quickening the pace at which corruption cases are prosecuted," said Sa'eed Husaini from a political analysis group, Control Risks.
"Security, his second big priority, will expand beyond a narrow focus on Boko Haram in the northeast, to include rural banditry in the northwest and Middle Belt."