At least 23 Nigerian troops were killed after being ambushed by "bandits" in a remote village in the north-west of the country, security sources said.
On Saturday evening, militants opened fire on the soldiers, who were on foot in a forested part of the Jibia district in Katsina state, the sources said.
Twenty-three bodies had been accounted for, but more troops were missing, a military source told the Agence France-Presse.
At least two bandits were injured in the skirmish, government sources told local media.
The armed gangs, known locally as "bandits", regularly have been involved in cattle rustling and kidnappings.
But experts have recently said they could be forging ties with extremist groups in the region.
Also on Saturday in the same area, five children were killed and six injured on a farm when a grenade they were playing with exploded, a spokesman for Katsina state police said.
It was not clear whether the two attacks were related.
The poverty-stricken Katsina, the home state of President Muhammadu Buhari, has become increasingly restive in recent years.
The Nigerian army regularly raids the forests where the armed groups hide, but the number of soldiers is insufficient and villagers organise themselves into civilian militia.
This month, 46 bandits were killed by security forces in a battle in the town of Yar Gamji, in the Batsari area of Katsina.
In May, the International Crisis Group cautioned that the armed gangs could be developing links with extremist groups such as IS in West Africa Province, which is already very powerful in north-west Nigeria.
The "bandits" have killed about 8,000 people since 2011 and forced more than 200,000 to flee their homes, the crisis group said in Brussels.