The only operational airport in the unrest-hit Libyan capital Tripoli suspended all flights Friday, an airport source said, after fierce fighting near the city that has left at least 39 dead this week.

Hundreds of people have been injured in the clashes between rival militias, which broke out on Monday in suburbs south of Tripoli, according to a new toll by the health ministry released Friday.

Fighting had temporarily ceased on Thursday following a ceasefire deal, but reignited in the evening and continued into Friday, with intermittent bursts of heavy fire.

Witnesses and Libyan rescue services said rockets and shells had hit multiple areas around and within the capital, causing civilian casualties.

Several rockets landed near Tripoli's Mitiga airport, forcing authorities to suspend flights for at least 48 hours for security reasons, according to the airport official.

The UN in Libya said it "strongly condemns the loss of civilian lives" in the city and called on all parties to prevent further casualties and cease hostilities in a statement on Twitter.

Flights were temporarily rerouted to the airport in Misrata, some 200 kilometres (125 miles) east of Tripoli, the airport source said.

The Libyan capital has been at the centre of a battle for influence between armed groups since the fall of dictator Moamer Kadhafi in 2011.

A former military airport, Mitiga was opened to civil air traffic after the destruction of Tripoli's international airport in the south of the city during clashes in 2014.

The internationally recognised Government of National Accord (GNA) has charged forces from the west and centre of the country with enforcing the ceasefire.

But a commander of these forces has declared that he has to wait for a pause in the fighting to be able to re-enter the capital and intervene between the rival factions.