The fighting erupted at about 5:00 pm (2130 IST) on Wednesday in Malam Fatori, a commercial hub known for fishing and farming in the remote north of Borno state near the border with Niger.
"Boko Haram tried to attack Malam Fatori... But they met stiff resistance from the Multi-National Joint Task Force who initially repelled the attack after prolonged fighting," said senator Maina Maaji Lawan.
"They pushed back the insurgents and people in the town and the soldiers thought it was over but the insurgents mobilised more men and weapons including an APC (armoured personnel carrier) and launched a renewed attack.
Local residents put the civilian death toll at 16 and claimed that dozens of militants were killed in the initial military response on the ground and from the air.
More From This Section
Aminu Ahmad, who lives in the Abadam local government area, of which Malam Fatori is the biggest town, estimated that "hundreds" of heavily armed Boko Haram fighters arrived in a convoy of pick-up trucks.
"Honestly, it was a bad outing for the insurgents because dozens of them were killed," he said.
The multi-national force was set up in the late 1990s to fight cross-border crime and arms trafficking but its remit was expanded to include Boko Haram, when the insurgency started in 2009.
The fighting forced thousands of people to flee the area across the border, said residents and Lawan, who represents northern Borno in the upper house of parliament.
"The town was deserted as a result of the attack and thousands of people crossed into Niger and are now camped in Bosso town which is only five kilometres away," he said.