At least 44 people were killed and more than 130 wounded in an air strike on a migrant detention centre in the Libyan capital Tripoli, the UN mission to the country said on Wednesday.
"This attack clearly could constitute a war crime, as it killed by surprise innocent people whose dire conditions forced them to be in that shelter," UN envoy to Libya Ghassan Salame said.
He called for the international community to punish those who ordered, carried out and provided arms for the strike, noting it was the second time the facility has been attacked.
"The absurdity of this ongoing war today has led this odious bloody carnage to its most hideous and most tragic consequences," Salame said in a statement.
An emergency services spokesman Osama Ali told AFP 120 migrants were detained in the hangar which was directly hit by the strike.
Rescuers were searching for survivors under the rubble, while dozens of ambulances rushed to the scene.
Bodies were strewn on the floor of a hangar in the Tripoli suburb of Tajoura, mixed with the belongings and blood-soaked clothes of migrants, an AFP photographer said.
"There were bodies, blood and pieces of flesh everywhere," a survivor, 26-year-old Al-Mahdi Hafyan from Morocco, told AFP from his hospital bed where he was being treated for a leg wound.
The head of the centre, Noureddine al-Grifi, said others had been wounded in a neighbouring hangar that was also damaged by the strike.
The five hangars in Tajoura held around 600 migrants and refugees, he said.
No-one has so far claimed responsibility.
"Migrants and refugees must NOT be detained; civilians must NOT be a target; Libya is NOT a safe place of return" for migrants and refugees, the head of the UN refugee agency (UNHCR), Filippo Grandi, said in a tweet.
The European Union called on the UN to launch an investigation.
"Those responsible should be held to account", EU diplomatic chief Federica Mogherini, enlargement commissioner Johannes Hahn and migration commissioner Dimitris Avramopoulos said in a statement.
UN human rights chief Michelle Bachelet said it was the second strike on the centre during the recent fighting, even though its coordinates had been communicated to the warring sides. It may - depending on the precise circumstances - be a war crime, she added.
Libya is one of the main departure points for African migrants, fleeing poverty and war, to try to reach Italy by boat, but many are picked up and brought back by the Libyan coast guard, supported by the European Union.
Migrants 'at risk'
UNHCR spokesperson Charlie Yaxley told AFP in Geneva that the agency had asked to have the centre evacuated a few weeks ago after "a near miss from a similar air strike".
The centre was thought to have been used to store weapons, he added, reiterating "that using civilian infrastructure like that constitutes a violation of international humanitarian law".
Doctors without Borders reacted via Twitter to the "horrifying events", saying "refugees and migrants trapped in Tripoli detention centres must be immediately evacuated".
Italy's Foreign Minister, Enzo Moavero Milanesi, said the strike was "another tragedy that demonstrated the atrocious impact of the war on the civilian population".
France called for "an immediate de-escalation" while the Arab League urged a "halt" to the fighting.
Rights groups say migrants face horrifying abuses in Libya, which remains prey to a multitude of militias vying for control of the oil-rich country.
The UN's mission in Libya has said around 3,500 migrants and refugees held in detention centres near the combat zone are at risk.
Frightened migrants were still at the detention centre after the strike, which partially destroyed the hangar. "Some people were wounded, and they died on the road, on their way running, and some people are still under the debris so we don't know what to say," said Othman Musa, a migrant from Nigeria.
"All we know is we want the UN to help people out of this place because this place is dangerous," he said.
Moussa Faki Mahamat, chairman of the African Union Commission, demanded an immediate ceasefire and an independent investigation "to ensure that those responsible for this horrific crime of innocent civilians be brought to account".
The plight of migrants has worsened since LNA forces lead by Haftar launched an offensive against Tripoli in early April.
Since then, fighting has killed more than 700 and wounded 4,000, while nearly 100,000 have been displaced, according to UN agencies.