Heavily armed gunmen raided a jail in south-central Nigeria late on Sunday, blowing up the perimeter fence and freeing 266 inmates – almost everyone in the prison, authorities said.

A soldier and a police officer were killed in the attack and two guards were missing, the interior ministry said. It was the second major jailbreak in Nigeria this year.

The attackers used explosives to destroy the fence on three sides and fought a gun battle with guards at the medium-security prison at Kabba in Kogi State, southwest of the federal capital Abuja, authorities said.

Nigeria is struggling with security problems across its vast territory, including armed robberies by criminal gangs, an Islamic insurgency in the northeast and a spate of mass school abductions in the northwest.

Twenty-eight out of the 294 inmates at Kabba had not escaped, the interior ministry said, meaning 266 had got away.

The prison service had initially put the number of fugitives at 240.

It was the second major jailbreak this year after gunmen attacked a prison in Owerri in southeastern Imo State in April, freeing more than 1,800 inmates.

Police blamed the Owerri jailbreak on a banned separatist movement, the Indigenous People of Biafra (IPOB), which campaigns for several southeastern states to split from Nigeria.

IPOB denied any involvement.

Kogi State is not part of the region IPOB wants to see secede. The authorities said the Kabba attackers had not been identified, and they did not suggest a reason for the raid.

The prison service said the Kabba jail was established in 2008 with a capacity for 200 inmates. At the time of the attack there were 224 pre-trial detainees and 70 convicted offenders in the jail, it said.

Suspects can spend years in pre-trial detention in Nigeria.

The interior ministry said there were 15 soldiers, 10 police officers and 10 armed prison guards on duty at the Kabba jail at the time of Sunday’s raid.