The raid in the town of Rann marks the latest high-profile attack by militants in the northeast, coming less than two weeks after militants abducted 110 girls from a school in the town of Dapchi in neighboring Yobe state.
The United Nations confirmed three aid workers, all Nigerian nationals, were killed in the attack in Rann, near the Cameroon border, and said a female nurse was missing, feared abducted. It said it was also concerned other civilians may have been killed or injured.
Four soldiers and four police officers were also killed, according to the Nigerian security reports seen by Reuters.
The militants, armed with rocket-propelled grenades and truck-mounted guns, initially overpowered soldiers in a firefight at the military facility but the armed forces later regained control, according to the two reports.
The attack is a further setback for President Muhammadu Buhari, who took office in May 2015 vowing to improve security and who has repeatedly said the Boko Haram insurgency has been defeated.
The government said on Friday that it was extending to neighboring countries the search for the girls taken in Dapchi, which is some 400 km (250 miles) west of Rann.
Borno state, where Rann is situated, is the epicenter of the Boko Haram insurgency, which aims to impose a strict interpretation of Islam in northeast Nigeria. More than 20,000 people have been killed and some two million forced to leave their homes since 2009.
Two of the aid workers who died were contractors with the International Organization for Migration, working as coordinators at a camp for 55,000 displaced people in Rann, the United Nations said. The third was a doctor employed as a consultant for UNICEF.
“We call on authorities to ensure the perpetrators are brought to justice and account,” Edward Kallon, the U.N. Humanitarian Coordinator in Nigeria, said in a statement.
Mohammed Abdiker, of the U.N. International Organization for Migration, said staff were“outraged and saddened” by the death of their colleagues.
Attacks on aid workers are rare, but not unheard of. In December, four people were killed when a World Food Program (WFP) convoy was ambushed in Borno state.
Boko Haram held a swathe of territory in northeast Nigeria around the size of Belgium in late 2014. It was pushed out of most of that land by Nigeria’s army, backed by troops from neighboring countries, in early 2015.
Although it has failed to control large areas of land since then, the group continues to carry out suicide bombings and gun raids in northeast Nigeria, Cameroon, Niger and Chad.
The camp for displaced people in Rann was bombed in an accidental Nigerian Air Force strike last year, killing up to 170 people.