Nigeria's military on Sunday said it had restored order after Boko Haram fighters took control of a town in the country's remote northeast, sparking fears about the group's resurgence.
Scores of jihadists believed to be loyal to a faction backed by the Islamic State group overran troops in Gudumbali on Friday, according to local officials and security sources.
At least eight civilians were thought to have been killed and thousands more forced to flee, in what was the Islamist extremists' first major seizure of a town in two years.
It also 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.
Nigerian Army spokesman Brigadier General Texas Chukwu, who on Saturday said he was "not aware" of the attack, 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 in a statement.
"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."
Nigeria's 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 Chukwu's claim, as access to areas outside the Borno state capital, Maiduguri, is tightly controlled by the military.
Nine years of conflict, which has claimed at least 20,000 lives in northeast Nigeria, has also destroyed telecommunications infrastructure in rural areas.
Gudumbali is 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 long-time Boko Haram leader Abubakar Shekau's indiscriminate targeting of civilians.
ISWAP is believed to be trying to get the support of local people in the Muslim-majority region by only hitting 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".