It was the highest publicly reported toll from an air strike or shelling since eastern forces under Khalifa Haftar launched a ground and aerial offensive three months ago to take Tripoli, the base of Libya's internationally recognized government.
United Nations Libya envoy Ghassan Salame condemned the strike, saying it "clearly amounts to the level of a war crime."
United Nations Secretary-General Antonio Guterres was outraged by the air strike and called for an independent investigation, his spokesman said. The U.N. Security Council was also due to meet on Libya behind closed doors later on Wednesday, diplomats said.
U.N. human rights chief Michelle Bachelet said it was the second strike on the center during the recent fighting, even though its coordinates had been communicated to the warring sides.
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.
Some 6,000 are held in government-run detention centers in what human rights groups and the United Nations say are often inhuman conditions.
The UNHCR refugee agency had already called in May for the Tajoura center, which holds 600 people, to be evacuated after a projectile landed less than 100 meters (330 feet) away, injuring two migrants.
The hangar-type detention center is next to a military camp, one of several in Tajoura, east of Tripoli's center, which have been targeted by air strikes for weeks.
Frightened migrants were still at the detention center 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 U.N. to help people out of this place because this place is dangerous," he said.
Clothes, flip-flops, bags and mattresses were littered on the floor next to what remained of limbs of dead. Blood stains coated some walls.
"Our teams had visited the center just yesterday (Tuesday) and saw 126 people in the cell that was hit. Those that survived are in absolute fear for their lives," medical charity Medecins Sans Frontieres (Doctors Without Borders) said in a statement.
HAFTAR ASSAULT ON TRIPOLI
Haftar's Libyan National Army (LNA) force, allied to a parallel government based in eastern Libya, has seen its advance on Tripoli held up by robust defenses on the outskirts of the capital, and said it would start heavy air strikes after "traditional means" of war had been exhausted.
His attempt to capture Tripoli has derailed U.N. attempts to broker an end to the chaos that has prevailed in the oil- and gas-producing North African country since the violent, NATO-backed overthrow of Muammar Gaddafi in 2011.
The U.N. called for an independent investigation and for perpetrators to be held to account.
In a statement, the Tripoli-based government blamed the "war criminal Khalifa Haftar" for the incident. The LNA denied it had hit the detention center.
On Wednesday, the LNA conducted another air strike on Tripoli's only functioning airport, which also has a military section, causing the closure of civilian traffic.
LNA spokesman Ahmed Mismari said the strike had destroyed a drones control room.
The LNA air campaign has failed to take Tripoli in three months of fighting, and last week lost its main forward base in Gharyan to Tripoli's forces.
Both sides enjoy military support from regional powers. The LNA has been supplied for years by the United Arab Emirates and Egypt, while Turkey recently shipped arms to Tripoli to stop Haftar's assault, diplomats say.The conflict threatens to disrupt oil supplies, boost migration across the Mediterranean to Europe, scupper U.N. plans for an election to resolve the rivalry between the parallel administrations in east and west - and create a security void that Islamist militants could fill.