Nigeria's army failed to protect Baga's civilians despite warnings that militants were going to attack, rights group Amnesty International has said.
Some reports say as many as 2,000 people died in Boko Haram's raids on the north-eastern town this month, but the government puts the toll at 150.
Amnesty quotes an unnamed senior army source as saying the Islamist militants told residents about the offensive.
But the defence spokesman told the BBC there had been continuous patrols.
"It is not true to say nothing was done," Maj Gen Chris Olukolade said in response to Amnesty International's allegations.
Boko Haram launched a full-scale insurgency in north-eastern Nigeria in 2009 to create an Islamic state.
But since the government declared a state of emergency 20 months ago in three north-eastern states to deal with it, Boko Haram has strengthened and now controls several towns, where it has declared a caliphate.
According to evidence gathered by Amnesty International, commanders at the military base in Baga, in the far north-east of Nigeria, regularly informed military headquarters in November and December 2014 of the threat of a Boko Haram attack and repeatedly requested reinforcements.
There were also warnings that the town of Monguno, about 140km (85 miles) north of Maiduguri city which was captured by Boko Haram on Sunday, would be attacked.
"Everyone was aware," a Monguno resident told Amnesty.
"Boko Haram came on Wednesday last week [21 January] and asked the villagers [in nearby Ngurno] to leave because they are coming to attack the barracks. The villagers told the soldiers."
Amnesty International's Africa director Netsanet Belay said the attacks were an "urgent wake-up call for the Nigerian leadership, the African Union and the international community".
Maj Gen Olukolade said in operational areas surveillance would have been continuous to ward off attacks.
Earlier this month, Chadian soldiers deployed to Cameroon's border with Nigeria to help secure the porous border.
African Union heads of state are going to include the conflict in north-eastern Nigeria on the agenda of their summit, due to begin on Friday.
Related stories: Boko Haram attacks the same town it kidnapped the schoolgirls from
Video - President Goodluck Jonathan visits Boko Haram hit North Eastern Nigeria