An airstrike hit the detention centre for migrants in the Libyan capital, killing around three dozen people. Picture: Hazem Ahmed/AP

Tripoli - At least 35 people have been killed in an airstrike on a refugee centre in the Libyan capital, an official said Wednesday, with the Tripoli-based government blaming military strongman Khalifa Haftar for the attack.

The strike also injured 73 people, emergency services spokesman Osama Ali, told dpa.

The centre houses more than 600 people, but the part that was hit held some 150 male refugees and migrants from different African countries, according to Mabrouk Abdel-Hafiz, a migration official affiliated with the Tripoli-based government.

In April, Haftar ordered his self-styled Libyan National Army (LNA) forces to capture the embattled Libyan capital from the UN-backed Government of National Accord (GNA), headed by Fayez Serraj.

The GNA blamed Haftar for the attack, saying it should be added to a "list of serious violations against humanity" committed by his forces.

A migrant picks up her belongings from rubble at a detention centre for mainly African migrants that was hit by an airstrike, in the Tajoura suburb of Tripoli. Picture: Ismail Zitouny/Reuters

"This shelling was deliberate, not indiscriminate," the government said in a statement urging the United Nations to investigate the incident.

The attack comes two days after Haftar's spokesman, Ahmed al-Mesmari, said that the LNA would launch airstrikes on Tripoli to target "terrorist groups".

The fighting, which left 739 people dead, including 41 civilians, and 4,407 injured, reached a stalemate, with neither side able to make substantial progress. Some 70,000 people have been displaced because of the fighting.

Blood stains are seen on a police car at a detention centre for mainly African migrants, hit by an airstrike in the Tajoura suburb of Tripoli. Picture: Ismail Zitouny/Reuters

The violence has raised global fears that UN efforts to find a political solution to Libya's eight years of unrest may be derailed.

Libyan Red Crescent workers recover migrants bodies after an airstrike at a detention centre in Tajoura, east of Tripoli. Picture: Hazem Ahmed/AP

The UN's refugee agency said was "extremely concerned" by reports of the airstrike. "Civilians should never be a target," UNHCR Libya said in a tweet.