LAGOS, Nigeria — Nigeria’s army claimed victory Wednesday in “a fierce battle” in a remote desert trading post where Islamic extremists said they killed 40 troops from a multinational force.

Army spokesman Col. Sani Kukasheka Usman said troops recaptured Malam Fatori town on Tuesday and killed several extremists. But the insurgents regrouped at the nearby border with Niger and attacked again Wednesday. “The operation is continuing,” Usman said.

The Islamic State’s West Africa Province, one faction of the Boko Haram extremist group, claimed it had annihilated “a convoy of the African Coalition Crusader forces” at Malam Fatori, killing more than 40 soldiers, according to the SITE Intelligence Group, which monitors extremist communiques.

There was no way to independently verify either side’s claim.

The army said troops “captured Malam Fatori,” though the military has repeatedly said the extremists no longer hold any territory.

Troops this year dislodged the insurgents from most towns and villages where they had declared an Islamic caliphate, but the extremists still operate across most of northeastern Borno state.

The U.N. Children’s Fund says more than 2 million starving people cannot be reached there because of the danger of attacks.

Tuesday’s battle was the first Nigeria attack claimed by the Islamic State group since August, when it named a new caliph in the country, provoking a leadership struggle. Leader Abubakar Shekau pledged Boko Haram’s allegiance to IS in 2015, giving the Islamic State its first sub-Saharan franchise. But IS last month announced it had replaced Shekau in a dispute around his indiscriminate killings of Muslims.

Malam Fatori has changed hands many times in the seven-year Boko Haram uprising that has killed more than 20,000. Many residents fled to Niger in 2014 after soldiers in a punitive raid burned hundreds of huts because a wounded extremist was given refuge there.