Officers stand guard outside the Kuje maximum prison following a rebel attack in Kuje, Nigeria, Wednesday, July 6, 2022. AP
The brazen attack on the outskirts of Abuja came hours after an ambush on a presidential security convoy in the northwest, in a fresh illustration of Nigeria's security crisis.
Residents reported loud explosions and gunfire late Tuesday near the Kuje medium security prison just outside Abuja, and security forces had cordoned off streets in the area early Wednesday.
One security official was killed when the gunmen breached the jail using explosives, correctional services spokesman Abubakar Umar said.
"Some of the men in custody escaped. We were able to recapture many of them this morning. More than 300 escaped, but we have recaptured close to 300," he told AFP.
He said prison officials were still determining how many were still missing.
Security forces were returning around 19 recaptured inmates back to the prison in a black van on Wednesday morning, an AFP correspondent at the site said.
Former top police commander Abba Kyari, who was being held in Kuje awaiting trial on drug smuggling charges, was still in custody, Umar said.
"We heard shooting on my street. We thought it was armed robbers," one local resident said. "The first explosion came after the shooting. Then a second one sounded and then a third."
It was unclear who carried out the prison attack but Nigeria's security forces are battling jihadists, heavily armed criminal gangs and separatist militias in different parts of the country.
The raid took place soon after gunmen also ambushed an advance presidential security detail preparing for President Muhammadu Buhari's visit to his home state of northwestern Katsina.
Two officials were slightly wounded in the attack though it was not clear who was responsible.
"The attackers opened fire on the convoy from ambush positions but were repelled," the presidency said in a statement.
Katsina is one of Nigeria's northwestern states where armed militias known locally as bandits are notorious for raiding villages and staging mass kidnappings for ransom.
Attacks on prisons in Nigeria have happened in the past, with gunmen seeking to free inmates.
More than 1,800 prisoners escaped last year after heavily armed men attacked a prison in southeast Nigeria using explosives.
The attackers blasted their way into the Owerri prison in Imo state, engaging guards in a gun battle before storming the prison.
Imo state is part of a region that is a hotbed for separatist groups seeking an independent state for the indigenous Igbo population.