Militants suspected to be from Islamist militant group Boko Haram killed more than 40 people in attacks on Bama.
Army spokesman Sagir Musa told Bloomberg News about 200 fighters showed up on buses and trucks equipped with machine guns. They later attacked a military barracks and fighting there left 10 attackers and two soldiers dead.
"(They) came in army uniform pretending to be soldiers," he said.
Boko Haram aims to establish an Islamic state in Nigeria, which is divided along Muslim and Christian lines.
The United Nations estimates that about 200 people were killed and more than 2,000 houses were destroyed following a Nigerian military raid in Baga. The raids were allegedly in response to an attack by Boko Haram.
The United Nations said it was concerned about allegations of the use of excessive force. Nigeria President Goodluck Jonathan, a Christian, said he was committed to holding the perpetrators accountable for any violations of the law.