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.
The toll from what was the Islamist extremists' first major seizure of a town in two years was put at at least eight by civilian militia sources, although the Nigerian army denied there were casualties.
It also followed a series of recent 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, said: "The encounter took place when the insurgents attacked the community, set some buildings ablaze and quickly withdrew from the community.
"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."
A military source in Maiduguri said troops returned to a deserted town on Sunday morning, indicating that Boko Haram had withdrawn voluntarily at some point on Saturday.
"Residents are yet to return to the town having fled to other places to escape the attack. The fighters looted the (military) base before leaving," he told AFP.
- Naval base -
Nigeria's military regularly trumpets its apparent successes against Boko Haram but has strongly denied previous reports of army casualties in attacks.
Access to areas outside Maiduguri, where much of the fighting has taken place, is strictly controlled by the military, making verification difficult or impossible.
Raids on military bases were a regular occurrence in 2013 and 2014, when the group seized territory across northeast Nigeria and briefly proclaimed a caliphate.
The military source in Maiduguri said Boko Haram also attacked a naval base in Fishdam, near Baga, on the shores of Lake Chad at about 10:20 pm (2120 GMT) on Saturday.
Fighting lasted into the early hours of Sunday and involved soldiers from the regional security force set up to stop cross-border Boko Haram attacks.
"The navy radioed the Multi-National Joint Task Force for reinforcements and the MNJTF responded by firing mortars on the BH position outside the base," the source said.
"Subsequently the soldiers were able to repel the attack. It is still not clear the level of casualties inflicted on Boko Haram."
The Nigerian Navy has been conducting operations against Boko Haram fighters based on islands on Lake Chad, where the borders of Nigeria, Niger, Chad and Cameroon meet.
- Questions -
The Gudumbali attack will raise fears that Boko Haram is again strong and confident enough to take on the Nigerian military and has boosted its arsenal.
It will likely also prompt questions about the policy of returning displaced people to the Guzumala area, of which Gudumbali is the district headquarters -- and elsewhere.
In recent months, the authorities have encouraged thousands of people made homeless by the long-running conflict to return home, insisting it is safe to do so.
But aid agencies dealing with the humanitarian effects of the insurgency disagree, and believe politics are dictating the returns, as elections approach in 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.
The former army general first said Boko Haram was "technically defeated" in late 2015 and recently claimed that Borno was in a "post-conflict stabilisation phase".
The Islamic State West Africa Province (ISWAP) faction split from long-time leader Abubakar Shekau because of his 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.