"So far we have recovered 18 dead bodies from the two villages Bale Shuwa and Bale Kura. The victims were killed while trying to escape the fight between the insurgents and the military," the State Emergency Management Agency (SEMA) said.
The incident occurred earlier on Monday near the Nigerian northeastern city of Maiduguri.
Nigeria has been facing the insurgency of the Boko Haram jihadists, who pledged allegiance to the Daesh terror group, outlawed in Russia, since 2009. The group staged a number of bloody terror attacks, including the 2011 bombing of a UN office in the country's capital of Abuja which killed 21 people.