Twenty-five soldiers were killed and nearly 1,000 people left homeless in a militant attack on a town in northeastern Nigeria, the government said in a statement. Six other soldiers were also wounded.
The militants entered Monguno in Borno state posing as a convoy of soldiers on Tuesday evening, the sources said. They then attacked troops inside the town, destroying at least 750 homes in the process.
Resident Gumati Sadu said people fled into the bush for safety during the fighting and that three civilians were killed by stray bullets.
A military spokesperson declined to comment.
Islamic State West Africa Province (ISWAP) claimed responsibility for the attack on its Amaq news agency.
It said that one of its militants detonated a car bomb in the town, killing at least eight soldiers and destroying three armoured vehicles.
The group also said it had seized a vehicle, weapons and ammunition before leaving the town.
The attack comes after Chadian troops who are part of the Multinational Joint Task Force withdrew from Borno some days ago. There are worries that more attacks will be carried out against key targets in the state.
On Saturday, six soldiers were killed in an attack by Boko Haram near Jakana, a town 45 kilometres away from Maiduguri, the capital of Borno state, according to Maj. Gen. Olusegun Adeniyi. He called for the evacuation of Jakana and another village, Mainok.
Nigeria's President Muhammad Buhari had on Tuesday told citizens not to panic over the withdrawal of the Chadian troops.
The military has not yet officially commented on the soldiers' deaths in the latest attack on Monguno.
ISWAP split from Islamist group Boko Haram in 2016 and has since staged its own frequent attacks in the region.
Boko Haram's decade-long insurgency campaign has killed thousands and displaced millions in northeastern Nigeria.
Thousands in Monguno had already been displaced from their homes elsewhere in Borno state by militants. Aid group Medecins Sans Frontieres warned last year that many thousands in Monguno lacked proper shelter, water, sanitation and food.