At least 70 people were injured in the raid on Tajoura, according to an emergency services spokesman. "This is a preliminary assessment and the toll could rise," he said.
He said 120 migrants were detained in the hangar which was hit directly by the strike.
Bodies were strewn on the floor of the hangar, mixed with the belongings and blood-soaked clothes of migrants, a French news agency photographer said.
Rescuers were searching for survivors under the rubble, while dozens of ambulances rushed to the scene.
In a statement, the internationally recognised national unity government (GNA) based in Tripoli denounced the attack as a "heinous crime" and blamed it on the "war criminal Khalifa Haftar".
- With France's backing, Libya's Sarraj hopes to come out of the cold
- Tripoli government attempts to pressure France over Haftar support
Haftar, who controls much of eastern and southern Libya, launched an offensive to take the capital in early April.
The GNA accused pro-Haftar forces of having carried out a "premeditated" and "precise" attack on the migrant centre.
Widespread condemnation of "horrific crime"
The African Union has condemned the air strike and demanded that those responsible for the "horrific crime" be held to account.
In a statement, the chairman of the AU Commission Moussa Faki Mahamat called for "an independent investigation to be conducted to ensure that those responsible for this horrific crime...be brought to account".
The killing of the migrants in Libya may amount to a war crime, according to the UN.
"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 special envoy to Libya, Ghassan Salame, said in a statement.
The EU has also condemned the air strike as "horrific", supporting the UN call for an immediate investigation.
France also condemned the airstrike, an act that has been blamed on Libyan strongman Khalifa Haftar, who has in the past enjoyed French backing.
France "condemns the strikes", the foreign ministry said in a statement, calling for "an immediate de-escalation and end to the combat" between Haftar's forces and those backing the internationally recognised national unity government in Tripoli.