Abuja: Nigeria`s government on Friday said that troops had begun a fightback against Boko Haram after the militants captured a key northeastern town and overran a military base last weekend.
The Islamists first attacked Baga, in the north of remote Borno state, on Saturday and on Wednesday set fire to the town and razed at least 16 towns and villages nearby.
Mike Omeri, who speaks on national security, said security forces had been "actively pursuing the militants" since the first attack and after the second.
"Security forces have responded rapidly and have deployed significant military assets and conducted airstrikes against militant targets," Omeri told reporters in Abuja.
There were fears of heavy casualties in the attacks, according to local reports, but it was not possible to obtain independent corroboration of the figures cited.
Local officials in and around Baga told AFP on Wednesday that at least 20,000 people were forced to flee their homes and that 560 had been stranded on an island on Lake Chad since Saturday.
Omeri said the country`s emergency management agency was helping 2,000 people displaced from Baga, while other agencies, including the Red Cross, were ready to assist when security allows.
Boko Haram has for the last six months captured dozens of towns and villages in northeast Nigeria as part of its aim to establish a hardline Islamic state.
The Baga attack effectively gave it control of all three frontiers of Borno state with neighbouring Niger, Chad and Cameroon, increasing fears of cross-border attacks.
Security analysts this week said that the militants were now in a better position to strike south towards the Borno state capital, Maiduguri, where the group was founded in 2002.
It has also cast doubt on the ability to hold general elections in the affected areas, scheduled for next month.
Andrew Noakes, of the Nigerian Security Network of analysts, said the assault on Baga may have targeted civilian vigilantes assisting the military after a series of previous strikes.
"Boko Haram had pledged to punish CJTF (civilian joint task force) members and it looks likely Baga was treated with such brutality to do exactly that, and to send a message to other vigilantes," he said in an email exchange.
"There will undoubtedly now be questions about the utility of the CJTF."
Nigeria`s government maintains it is on top of the situation, despite repeated claims of a lack of military presence in the region and complaints from soldiers about inadequate weapons and kit.
Omeri condemned the latest attacks as "brutal and barbaric" and said they represented "none of the people of Nigeria and no religion".
"The government of Nigeria will not rest until Boko Haram is completely dismantled," he added.
"The government values every town, every community and every Nigerian equally. No inch of Nigerian soil will remain in the hands of these terrorists."