Gunmen attacked the main prison in Niamey, the capital of Niger, killing at least four people on Saturday afternoon.
They are thought to be members of the Movement for Unity and Jihad in West Africa (Mujao) groups.
The prison is now surrounded by security forces.
The attack began at around 3pm on Saturday.
Mujao said recently it was behind suicide bombings at a military base and a French-operated uranium mine on 23 May which killed 25 people.
The BBC reports Mujao is a splinter group of al-Qaeda in the Islamic Maghreb. It says its objective is to spread jihad to West Africa