Eight people are thought to have died when jihadists seized Gudumbali on Friday
Nigerias military has said it has restored order after Boko Haram fighters took control of a town in the countrys remote north-east, sparking fears about the groups resurgence.
Scores of jihadists believed to be loyal to a faction backed by Islamic State overran troops in Gudumbali on Friday, according to local officials and security sources.
At least eight civilians are thought to have been killed and thousands were more forced to flee, in the extremists first major seizure of a town in two years.
It followed a series of deadly attacks on troops, which have called into question repeated government and military claims that Boko Haram is weakened to the point of defeat.
A Nigerian army spokesman, Brig Gen Texas Chukwu, said on Saturday he was not aware of the attack but on Sunday confirmed the incident.
The encounter took place when the insurgents attacked the community, set some buildings ablaze and quickly withdrew from the community, he said. However, no human casualty was recorded in the encounter. The troops have regrouped and normalcy has been restored. The troops have also been reinforced with additional troops to dominate the general area.
Nigerias military regularly trumpets its apparent successes against Boko Haram and has strongly denied previous reports of army casualties in attacks.
There was no independent verification of Chukwus claim, as access to areas outside the Borno state capital, Maiduguri, is tightly controlled by the military.
Nine years of conflict has claimed at least 20,000 lives in north-east Nigeria and also destroyed telecommunications infrastructure in rural areas.
Gudumbali is in the Guzamala area of Borno and one of a number of places where people displaced by the long-running conflict have been encouraged to return.
Aid agencies dealing with the humanitarian effects of the insurgency believe the returns are being dictated by politics, with elections scheduled for February next year.
President Muhammadu Buhari, who was elected in 2015 on a promise to defeat Boko Haram, is hoping to secure a second four-year term.
He first said Boko Haram was technically defeated in late 2015 and recently said Borno was in a post-conflict stabilisation phase, despite the continued attacks.
The Islamic State West Africa Province (ISWAP) faction broke away in 2016 because of the long-time Boko Haram leader Abubakar Shekaus indiscriminate targeting of civilians.
ISWAP is believed to be trying to get the support of local people in the Muslim-majority region by attacking only government and military targets.
Chukwu called for people to remain calm and resilient but also to be aware of strange faces, to prevent fleeing Boko Haram terrorists from infiltrating and hibernating in their communities.