THE fighting between the jihadists of Boko Haram and the Nigerian government has uprooted almost 2m people in north-eastern Nigeria; more than 5m are in need of food aid. The misery in the region was compounded on January 17th, when a Nigerian military jet mistakenly bombed an informal refugee camp sheltering thousands of people displaced by the violence.

At least 76 people were killed and more than 100 were injured when the bombs hit Rann camp, home to 43,000 people. Among the dead were six Red Cross volunteers and three Médecins Sans Frontières contractors.

The air strike—a “regrettable operational mistake”, according to Nigeria’s president, Muhammadu Buhari—reinforces long-standing doubts over the level of training and skills of Nigeria’s security forces, and the efficacy of its counter-terrorism operation in the region. Although soldiers are no longer sent off to fight without boots or bullets by generals sitting safely in the capital, as regularly happened two years ago, deficiencies in training and equipment are still evident.

The botched strike appears to have been caused by a combination of faulty intelligence and weak controls aimed at ensuring that air strikes do not cause civilian casualties. Major-General Lucky Irabor, a local commander, said that he had ordered the attack in the belief that it was targeting a group of Boko Haram fighters in an area in which the group is known to operate. But the camp that was bombed is under the control of the army. “This was a very densely populated place that was full of civilians who already lived there and internally displaced persons who had come there,” Hugues Robert of MSF told the Guardian, a newspaper.

The incident also highlights how Nigeria’s army, which was once seen as the region’s most powerful, is still struggling to quell an insurgency by a ragtag group of jihadists. Mr Buhari has repeatedly claimed to have all but eliminated Boko Haram, which split into two factions in August 2016. A year ago he declared that the group had been “technically defeated”; on December 24th he claimed to have crushed the insurgents “in their last enclave”.

Yet to judge by the mishap at Rann, dealing with those final dregs still requires large air strikes. Indeed, the president tweeted that Nigerian forces had been “working to mop up BH insurgents” when they hit the camp.

In fact, insecurity is still widespread across the region. Attacks have increased in recent weeks since the end of the rainy season allowed the terrorists to move more freely out of their redoubts in the Sambisa Forest (fighting usually tapers off in the wet season as mud-track roads turn into rivers). Less than three weeks ago soldiers fended off militants who attacked a military post in Rann, killing 15 of them, according to local media. On January 16th suicide bombers struck the University of Maiduguri, killing a professor and a child alongside the attackers.

And despite the army’s repeated claims to have cleared Boko Haram from the area, the group’s fighters are still at large just outside many of the north-east’s camps and towns. The Nigerian army will not beat them unless it learns how to identify friends from foes.