A Nigerian air force jet has accidentally killed and injured many civilians in Rann, in the north-east of the country, the military has said.
International aid agency MSF says at least 50 people were killed and more than 100 injured in the incident.
Aid workers are among the casualties - the Red Cross says six of its workers are confirmed dead.
The attack took place near Nigeria's border with Cameroon where the army has been fighting Boko Haram militants.
Army spokesman Maj-Gen Lucky Irabor said the jet's pilot had mistakenly believed he was attacking insurgents. He said the mission had been ordered, based on intelligence about a gathering of Boko Haram fighters.
Nigerian President Muhammadu Buhari has sent a message expressing his dismay at the loss of life and pleading for calm.
His spokesman said Mr Buhari's administration would offer help to the government of Borno state "in attending to this regrettable operational mistake".
MSF said many of the casualties were believed to be displaced people who had fled from areas where Boko Haram had carried out attacks.
The charity's director of operations, Jean-Clement Cabrol, said: "This large-scale attack on vulnerable people who have already fled from extreme violence is shocking and unacceptable."
MSF spokesman Etienne l'Hermitte urged the Nigerian authorities to facilitate evacuations of those injured, by land and air.
"Our medical and surgical teams in Cameroon and Chad are ready to treat wounded patients," he said.
"We are in close contact with our teams, who are in shock following the event."
It is the first time an accident of this type has happened in north-east Nigeria and comes as the military carries out what it is calling its final push against Boko Haram.