At least 17 soldiers were killed when armed gangs attacked three of the army's forward operating bases in central and northwestern Nigeria.
In what appeared to be a coordinated assault, the gangs, commonly referred to locally as bandits, attacked bases on Tuesday in the states of Niger and Kaduna.
The attackers engaged troops in prolonged firefights lasting several hours.
"Sadly, some gallant warriors paid the supreme price in the day-long battles while four troops wounded in action are currently receiving treatment for their gunshot wounds," the army said in a statement on Wednesday.
One officer told the AFP news agency, "bandits attacked the camp while others laid ambush on soldiers outside."
Nigerian Army launched counteroffensive
The Nigerian Army confirmed the attacks and said it had launched counteroffensives in coordination with the Nigerian Air Force, which resulted in "significant enemy losses."
Armed groups operating in the northwest are known for mass kidnappings for ransom and frequent attacks on security personnel. They maintain camps in a vast forest that spans parts of Zamfara, Katsina, and Kaduna states in the northwest, as well as Niger state in the central region.
In addition to fighting armed gangs, the Nigerian military continues to face persistent threats from Boko Haram and "Islamic State"-affiliated groups operating in the region.
Earlier in June, gunmen killed scores of people in Benue state. Amnesty International Nigeria said that at least 100 people were killed, and police later reported that 26 suspects were arrested in connection with the attack.
Edited by: Saim Dušan Inayatullah