A "large number of gunmen" have attacked a Nigerian police base in the capital, Abuja, where Boko Haram militants are often held, police say.
A police statement said the attack was repelled but that 30 detainees escaped, 25 of whom were recaptured.
None of those who escaped were held on terror-related charges, it said.
No group has said it carried out this attack but Boko Haram Islamist militants have staged numerous attacks in Nigeria in recent years.
The group wants to establish Islamic law in Nigeria and has killed hundreds of people this year, mostly in the mainly Muslim north.
The attack on the Special Anti-Robbery Squad (Sars) headquarters in Abuja comes a day after a double suicide bombing killed 11 people in a church inside a military barracks in Kaduna state, north of the capital.
The Sars base is near several government buildings and security is normally extremely tight in the area.