At least 52 people have been killed and 120 wounded, including refugees and aid workers, when a Nigerian warplane mistakenly bombed a refugee camp in an attempt to target Boko Haram insurgents.

The estimate of 52 dead from the horrific military blunder was provided by Médecins sans Frontières, a respected aid agency at the site, although Associated Press quoted a government official as saying the death toll was more than 100.

The Red Cross said the dead included six of its workers, with another 13 injured. Nigerian President Muhammadu Buhari expressed "regret" over the attack and promised to help the victims.

Story continues below advertisement

MSF (Doctors Without Borders) released photos showing scenes of devastation at the refugee camp after the air strike: smoking rubble and crushed metal shacks within a few metres of a row of white-sheeted refugee tents; a small injured child being carried by a man, and several bodies covered in blankets.

The Nigerian government has repeatedly declared that it has defeated Boko Haram, and Mr. Buhari said the mistaken air strike was intended to be a "mopping up" of the rebels. But the attack has instead highlighted the continuing bloodshed in a conflict that has killed at least 20,000 and left more than 2.6 million homeless.

Despite the government's confident proclamations, Boko Haram, the radical Islamist militia that has been waging war against Nigerian forces for the past decade, is still killing hundreds of people in suicide bombings and other attacks.

Nigeria's military has been notoriously heavy-handed in its response to the insurgency, killing and injuring many civilians in raids and air strikes. The latest deadly blunder has highlighted the dilemma of Western governments as they try to decide how much equipment and aid to provide to the Nigerian security forces.

Story continues below advertisement

It also highlights the humanitarian catastrophe in the region, where hundreds of thousands of refugees are trapped in remote and dangerous regions with little assistance. Nearly five million people are in urgent need of food aid in Nigeria and neighbouring countries as a result of the Boko Haram conflict, the United Nations says.

Relief agencies were stunned by the disastrous air strike on Tuesday morning as food was being distributed to the refugees. "This large-scale attack on vulnerable people who have already fled extreme violence is shocking and unacceptable," said a statement by Dr. Jean-Clément Cabrol, the MSF director of operations.

"We are urgently calling on all parties to ensure the facilitation of medical evacuations by air or road for survivors who are in need of emergency care."

The attack took place at the town of Rann, near the border of Cameroon in northeastern Nigeria, where an estimated 25,000 refugees have been sheltering from attacks by Boko Haram.

Story continues below advertisement

A statement by the International Committee of the Red Cross said the attack killed six Red Cross workers and injured 13 who were "part of a team bringing desperately needed food for more than 25,000 displaced people in Rann."

Two soldiers and an unknown number of MSF workers were also among the injured, a Nigerian military commander said. The military said it sent helicopters to the refugee camp to help evacuate the wounded.

Mr. Buhari said the government is "attending to" the victims of the attack. "I received, with regret, news that the Nigerian Air Force, working to mop up Boko Haram insurgents, accidentally bombed a civilian community in Rann," he said in a statement. "I sympathize with the families of the dead, and with the injured."

Some analysts questioned how a warplane could be conducting air strikes if the military is merely in a "mopping up" operation.

Story continues below advertisement

Major-General Lucky Irabor, head of the Nigerian military operation against Boko Haram, told local reporters that he had ordered the air strikes after receiving reports of activity by the militia in the region.

"Unfortunately the strike was conducted, but it turned out that the locals somewhere in Rann were affected," Gen. Irabor told a media briefing in Maiduguri, the biggest city in northeastern Nigeria.

He said the deaths were "disturbing" but could not give an estimate of the casualties.