Nigerian soldiers blanketed the town of Bama on Wednesday, where residents stayed indoors after coordinated assaults by heavily armed Islamist insurgents killed 55 people.
The military said the brazen raid was carried out by some 200 gunmen from the extremist group Boko Haram, who stormed the town in a convoy of six 4x4 trucks and a bus, armed with machine guns, anti-aircraft weapons, and rocket-propelled grenades.
Disguised in army uniforms, the insurgents broke into a prison, killed 14 guards and set free 105 inmates, the military in northeastern Borno state said.
Their attempt to overrun a military barracks was repelled, but the gunmen succeeded in ransacking a police station, a primary school and several government buildings, army spokesman Brigadier General Ibrahim Attahiru told journalists Wednesday.
The raid left 22 police officers, four civilians and two soldiers dead, while 13 Islamists were killed in the fighting, the military said.
The town was paralysed a day after the violence.
"Only a few people have ventured beyond their front doors," said Bama resident Musa Bra. "Troops are all over the town patrolling the streets."
He explained that many people fled to the bush after the pre-dawn attack on Tuesday.
While some have tried to return, the military is screening everyone entering the town and asking for proof that they are civilians and not members of the insurgent group which has become notorious for blending in with the local population, Bra further said.
"Everybody is indoors," said another resident who asked that his name be withheld. "It is just military all over the town."
An AFP journalist who visited Bama on Tuesday said shops, petrol stations and markets had shuttered, and there were burnt vehicles by the roadside.
The military spokesman in Borno, Lieutenant Colonel Sagir Musa, told AFP the security forces were measuring the response to the carnage in order to limit the impact on civilians.
"We aren't going to be going to houses to fish out the fleeing attackers because such operation could create fear and confusion among the people," Musa said.
"We respect their right to life and privacy and we won't do anything contrary to our rule of engagement," he added.
Musa's comments come amid accusations that soldiers caused the deaths of scores of civilians last month in the town of Baga, northeast of Bama, by deliberately setting fire to hundreds of homes.
The brutal clashes in Baga killed nearly 200 people on April 16 and 17, the deadliest-ever episode in the Boko Haram insurgency, which has cost 3,600 lives since 2009, including killings by the security forces.
Nigeria's military has fiercely denied allegations from rights groups and residents that soldiers have committed massive abuses during operations against the Islamists.
Borno state is a Boko Haram stronghold and has seen scores of attacks since the group relaunched its insurgency in 2009.
The militants had used the state capital Maiduguri as their home base, but, amid a security crackdown in the city, the bloodshed appears to have spread north to remote towns near the porous borders with Chad and Niger.
The military has suggested that foreign fighters have joined the largely Nigerian ranks of Boko Haram, while some warn that the group continues to seek closer ties with Al-Qaeda's North Africa affiliate.
Boko Haram has said it is fighting to create an Islamic state in predominately Muslim northern Nigeria, but its demands have shifted repeatedly.
Analysts and Western governments have urged Nigeria to address crippling poverty in the north, saying dejected youths frustrated with government corruption have been radicalised and are now fighting alongside the insurgents.
The north is considered poorer than the mostly Christian south, but poverty remains endemic across the country, Africa's most populous and top oil producer.