MAIDUGURI, Nigeria — Nigerian soldiers rescued 71 people, almost all girls and women, in firefights that killed many Boko Haram militants in villages near the northeastern city of Maiduguri, the military said Thursday.

Some captives told The Associated Press they were in the clutches of the Islamic extremists for as long as a year.

"I was waiting for death ... they often threatened to kill us," said Yagana Kyari, a woman in her 20s who said she had been kidnapped from her village of Kawuri and taken to a militant camp in Walimberi, about 40 kilometers (25 miles) southeast of Maiduguri, the biggest city in the northeast and the birthplace of Boko Haram.

Kyari said they often went hungry because the extremists never provided enough food.

"Our gallants troops have rescued a total number of 59 civilians in two camps of the terrorist group," army spokesman Col. I.T. Gusau said. "Many of the terrorists were killed in the course of the operations, but mop up is still going on."

Women and children rescued by Nigerian soldiers from Boko Haram extremists in northeast Nigeria eat a meal on their arrival at the Military office in Maiduguri, Nigeria, Thursday, July 30, 2015. Soldiers rescued 71 people, almost all girls and women, in firefights that killed many Boko Haram militants in villages near the northeastern city of Maiduguri, Nigeriaâ€™s military said Thursday. (AP Photo/Jossy Ola)

The 59, all women and children except for five elderly men, were freed on Thursday, he said. Another 12 women and girls were rescued Wednesday from Kilakisa, 90 kilometers (55 miles) southwest of Maiduguri, he said.

The military has said hundreds of captives were freed in March when they declared they had seized back all towns held by Boko Haram, which last year had declared an Islamic caliphate in a large swath of the northeast.

But attacks have increased in recent weeks, with hundreds killing in suicide bombings and village assaults.

At least two women and girl suicide bombers this month were said to have come from the area where those freed this week were held. It is feared Boko Haram is turning its captives into weapons.

Nigeria's home-grown Islamic group drew international outrage with the April 2014 kidnapping of nearly 300 schoolgirls from the remote northeastern town of Chibok. Many of them escaped on their own, but 219 still are missing.

Michelle Faul reported from Lagos.

Think your friends should see this? Share it with them!

Story copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

Feedback, Corrections and Other Requests: AP welcomes feedback and comments from readers. Send an email to info@ap.org and it will be forwarded to the appropriate editor or reporter.