File picture: AFP

Abuja - Detainees suspected of being members of the Islamist militant group Boko Haram overpowered their guards at a prison near Nigeria's presidential villa in Abuja, seizing a rifle and triggering a gun battle that killed 21 people, security officials said.

The prisoners struck on Sunday as the guards from Nigeria's State Security Service (SSS) came in to feed them at their headquarters' prison near the residence of President Goodluck Jonathan, SSS spokeswoman Marilyn Ogar said.

The military was deployed to quell the unrest. Ogar did not say how many of the dead were inmates or security personnel.

A security source said at least one guard was killed in the gun fight before the military turned up.

Jail breaks by Islamists in Nigeria are common. Boko Haram militants, who are fighting to create an Islamic state in Nigeria and are seen as the main threat to Africa's top oil producer, attacked the main military barracks in the northeast, freeing dozens of prisoners on March 14. Most were killed trying to escape, witnesses on the scene said.

An al-Qaeda-linked group called Ansaru claimed a daring jail break at the Special Anti-Robbery Squad headquarters in Abuja in November 2012 that freed dozens of prisoners. - Reuters