Anti-terrorist forces trying to regain control of complex seized amid explosions.
Several other people were wounded.
They had requested military and logistics support from the Somali government but decided to take matters into their own hands.
Military and security personnel who did not want to be named told Reuters on Saturday up to 30 soldiers had been killed in the Zari attack.
The police officers and soldiers had been sent to reinforce the town of Pama after a police station there was recently attacked.
It regretted that a woman and a teenager had also been killed in the strike that took place overnight on Sunday into Monday.
The Nigerian military’s dismissive response to this report is typical of its default stance of downplaying or denying losses.
President Roch Kabore urged the public Saturday to cooperate more closely with the country’s military, following a coordinated attacks on France's embassy.