The operation in the country's conflict-torn northeast also led to the capture of a Boko Haram commander, an army spokesman said in a statement late Sunday. The military said earlier that it had killed a "large number" of the militants in air strikes in the northeast.
Read: Boko Haram fighters kill 13 villagers in attack in NE Nigeria: witnesses
The operation took place on Sunday near Aulari, about 70 kilometres (40 miles) south of Maiduguri, the capital of Borno state, once a militant stronghold.
"During the offensive operations, 178 people held captive by the terrorists were rescued," military spokesman Colonel Tukur Gusau said, without specifying when the rescue took place.
"They include 101 children, 67 women and 10 men."
The Nigerian military has announced the release of hundreds of people held by Boko Haram in recent months, especially in the notorious Sambisa forest, a longtime extremist stronghold.
The air strikes hit the village of Bita on the fringes of the forest not far from the Cameroonian border, where Boko Haram was preparing to launch an offensive, the military said. "Many" militants were killed, it added.
Sunday's rescue came after several attacks by Boko Haram in recent days. Thirteen people were killed in an assault on Malari village about 20 kilometres from Maiduguri.
Local farmer Moha Saleh confirmed the death toll and said 27 people were wounded when the militants stormed the village.
"They also set many houses ablaze after accusing us of telling soldiers their whereabouts," he told AFP.
Local resident Goni Musa, a vigilante who fights Boko Haram alongside the Nigerian military, gave the same death toll.
"This morning 13 bodies were recovered. Some had been shot in the back, which means they were fleeing when the terrorists killed them," Musa said.
"They burnt down houses and shops before they left, yelling 'Allahu Akbar' (God is greatest). Our terrorised women and children fled into the bush and returned to Maiduguri this morning," he added.
State police commissioner Aderemi Opadokun confirmed the attack but gave a lower toll, saying seven people had been killed.
Malari has been the target of numerous attacks in recent months, including a suicide bombing by a youth in a mosque in the middle of the Muslim holy month of Ramadan in July which left 12 people dead.
Boko Haram has increasingly expanded its operations into neighbouring countries in recent months, prompting Nigeria, Cameroon, Chad and Niger to launch a coordinated military fightback.
The four countries, along with Benin, are preparing to launch a new 8,700-strong force that officials say will go into action soon.
Niger's President Mahamadou Issoufou on Sunday vowed that the new regional force would "eradicate" the insurgents.
"The multinational joint force will eradicate... the blind terrorism of Boko Haram," Issoufou said in a televised speech.
The militant group has stepped up its attacks since Nigeria's new President Muhammadu Buhari took office in May, unleashing a wave of violence that has claimed 800 lives in just two months.
Witnesses said the group attacked the town of Gamboru on Saturday, near the border with Cameroon.
Residents in nearby villages said the militants had set fire to houses, sending columns of black smoke into the sky.
Read: Revenge strike: Boko Haram blamed for killing at least 25
Umar Babakalli, a refugee from Gamboru who fled to the nearby Cameroonian town of Fotokol several months ago, said he saw fighter jets circling overhead "but there was no sign of any bombardment".
It was not immediately clear if anyone had been killed in Gamboru but Babakalli said the town, which has faced repeated Boko Haram assaults, was deserted. "There is nobody in Gamboru," he told AFP.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ