Islamic State (IS) killed 11 Nigerian soldiers in an attack on Gajiganna town, the group claimed through its news agency AMAQ.
The Jihadist organisation said the attack was in the town in north-eastern Borno state on Friday. It published pictures of burned barracks and dead bodies it claimed were soldiers.
Three sources, including one hospital source, confirmed the attack. They said militants stormed the town on a motorcycle and opened fire on residents and the military in sporadic shooting.
The fighters fled after the military called in air support and reinforcements from a battalion in a neighbouring town.
Islamic State West Africa Province (ISWAP) carried out a string of attacks in Nigeria in recent months.
The group split in 2016 from Nigeria-based Boko Haram, which has waged a decade-long insurgency in north-east Nigeria killing about 30,000 and displaced a further two million people.