His force said Friday it had driven a rival militia, led by the head of a former people smuggling network, out of the city after three weeks of fighting.

The clashes left 39 people dead and 300 wounded, according to the unity government’s health ministry.

The fighting also damaged schools, hospitals and UNESCO-listed archaeological treasures in Sabratha, 70 kilometres (45 miles) west of Tripoli.

Following the ouster and killing of long-time dictator Moamer Kadhafi in a NATO-backed 2011 revolution, the city became a major hub for clandestine migrants seeking a chance to head to Europe.

Taking advantage of a security vacuum, some local smugglers controlled whole sections of the city and even built their own landing piers, equipped to launch dozens of migrant boats a day.

The Government of National Accord has struggled to impose its authority in a country where dozens of militias hold sway and a rival government backed by military strongman Khalifa Haftar controls much of the east.