Scores of Islamic State West Africa Province (ISWAP) fighters invaded the town of Dikwa in restive Borno state, dislodging troops from the military base and torching the humanitarian hub, a military source told AFP on Monday.
"We have 25 staff sheltering in the bunker which is under siege by the militants... but so far no staff has been affected," a humanitarian source said, speaking on condition of anonymity.
Military reinforcements, including fighter jets and a helicopter gunship, had been deployed to help repel the attackers, the military source said.
A spokesman for UN chief Antonio Guterres confirmed only that there was a "security incident", but gave no further details.
For more than a decade, Nigeria's military has battled an insurgency by the Islamist group Boko Haram that has devastated the northeast, killing at least 36,000 people and displacing more than two million.
The ISWAP group split from Boko Haram in 2016 and has become a dominant threat in the region, attacking soldiers and bases while killing and kidnapping passengers at bogus checkpoints.
The violence has spread into neighbouring Niger, Chad and Cameroon, prompting a regional military coalition to fight the militants.
The latest attack comes after Nigerian President Muhammadu Buhari replaced his four top military commanders after months of pressure over his government's failure to end the Islamist insurgency.
The latest assault in Dikwa comes three years to the day after ISWAP fighters attacked a UN humanitarian hub in the remote northeastern town of Rann, killing three aid staff and abducting a female worker.
On Friday, ISWAP fighters in trucks fitted with machine guns raided Dikwa, sending residents fleeing.
The town, 90 kilometres (55 miles) from the Borno state capital Maiduguri, is home to more than 130,000 people, including 75,000 who had already fled from other parts of the region and were living in camps where they rely on food handouts from aid agencies.