Nigeria's Boko Haram sect attacked a prison in neighbouring Niger overnight, hours before Niger's parliament was due to vote on joining a regional offensive against the militants, witnesses said.
Heavy gunfire rang out as Niger's army repelled the attack, Boko Haram's third assault on the border town of Diffa in four days, residents and military sources told Chat212.
Authorities ordered locals to stay in their homes and mounted roadblocks around the town by late morning. Residents said many had fled.
"It's now evident that Boko Haram has its cells, its sleeping networks in the town and the region of Diffa," said a military source there.
It was not immediately clear how many people were killed or wounded, or whether any of the prisoners were freed.
A member of the national guard, which runs prison security, said about 100 suspected Boko Haram militants were held in Niger, but none of them in Diffa.
Boko Haram has killed thousands and kidnapped hundreds in its bid to carve out an Islamic emirate in northeastern Nigeria.
It has expanded its operations zone into neighbouring Cameroon and attacks near Lake Chad - a crossroads between Nigeria, Chad, and Niger - have sent tens of thousands of refugees fleeing across the borders.
On Saturday, the governments of Cameroon, Chad, Niger, Nigeria and Benin agreed to establish an 8,700 strong multi-national force to take on Boko Haram.
Niger's parliament was due to vote on Monday on whether to authorise the army to cross the border into Nigeria to participate in the regional offensive. Troops from Chad are already carrying out operations inside Nigerian territory.