Mounting attacks from jihadists and criminal gangs, including a brazen assault close to the capital, are creating a headache for Nigerian President Muhammadu Buhari as he sees out his last six months in office.

Last month, the Islamic State group's Nigerian affiliate ISWAP claimed a jailbreak outside just 20 kilometres (12 miles) from Abuja's international airport, freeing hundreds of prisoners, including 64 jihadist commanders.

Located in the centre of the country, the capital is far from the jihadists' usual area of operations in the northeast -- the city's last major attack was back in 2015.

In the same month, a military checkpoint was attacked on the outskirts of the capital and a presidential security convoy was ambushed in the country's northwest.

At least 40 worshippers were killed in June in a Catholic church in southwestern Owo, and last week five people were killed in Kogi state, in the centre of the country, when gunmen opened fire on a bus.

Idayat Hassan, head of the Centre for Democracy and Development think tank, said security was now front and centre of public concerns.

"There is growing pressure from Nigerians across all walks of life on the need to address the insecurity plaguing the country," he said.

"The problem currently is nowhere is safe in the country -- and nobody, irrespective of class or position in life, is safe."

Presidential elections are due to take place next February for a successor to Buhari. The former army general, first elected in 2015 and reelected in 2019, is scheduled to step down after two terms.

One of Buhari's big campaign promises was to end insecurity -- and the relentless violence has left him politically exposed.

"Most of us have been supporters of Buhari because he is a general," said a member of the ruling party, Chief Frank Kokori, a former labour leader and rights activist.

"We feel he is negligent (with) the security of the country, that is obvious, and he has to wake up because he has squandered his goodwill."

A security source based in the northeast and who asked to remain anonymous, said "Buhari is in an unenviable position."

"Naturally he is to take responsibility for any security failures as the head of government, but the truth is that he is helpless."

Despite hefty investments in the security apparatus, the situation has "continued to deteriorate," he said.

Opposition lawmakers threw down the gauntlet last month, threatening to impeach Buhari if he failed to stem the violence.

But the announcement is widely seen as an empty threat, given the ruling party's parliamentary majority.

Udo Jude Ilo, analyst and consultant with Thoughts and Mace Advisory, said the government had manifestly failed on the security issue.

He pointed to the holdup in March of a recently-inaugurated high-speed passenger train between Abuja and the northern city of Kaduna.

Eight people were killed, 26 were wounded and an unknown number were taken hostage.

"No-one was fired," Ilo said. "The service chiefs are still there. It is unbelievable."

Faced with a complex security crisis, the 79-year-old president has appeared aloof, multiplying foreign trips and communicating as much on his cabinet members' birthdays as on the attacks themselves.

All the while, criminal gangs known as "bandits" continue to wreak havoc across the northwest and centre, raiding villages and kidnapping residents every week.

In the northeast, a 13-year-old jihadist insurgency that has already claimed more than 40,000 lives and displaced at least two million people is undimmed. The militants are even expanding south.

Analysts have warned of links between bandits and jihadists -- an alliance that could create even more troubles for the government and security agencies.

Nigeria is also facing a dire economic outlook, with inflation rising on the back of the Covid pandemic and Russia's invasion of Ukraine.

Since 2015, when Buhari came to power, "there has not been a coherent policy to tackle not only insecurity but also the drivers of insecurity," said Ilo.

There is a "a combustive interaction of factors: the economy is doing badly, the country doesn't have enough resources to pay its debts, inflation has been growing for months."

A lack of jobs is also creating fertile ground for people to "become radicalised," he warned. "It is a frightening combination."