SABRATHA, Libya (Reuters) - An armed alliance involved in a three-week battle over the Libyan smuggling hub of Sabratha said on Saturday it had taken over protection of the Mellitah oil and gas terminal after expelling a rival group.

Slideshow ( 3 images )

An organization called the Operations Room and its allies have been fighting the Anas al-Dabbashi brigade, a major facilitator of migrant smuggling that recently said it had changed tack and struck a deal with the U.N.-backed government in Tripoli to stop boats setting off across the Mediterranean.

The fighting killed 17 and wounded 164, Omar Abduljaleel, commander of the Operations Room, told reporters in Sabratha, a town west of the capital Tripoli.

The Dabbashi brigade had been guarding the facility west of Sabratha since 2015. It is run jointly by Libya’s National Oil Corporation (NOC) and Italian firm Eni.

The setback for the Dabbashi brigade creates new uncertainty over the control of migrant flows from Libya.

Since a 2016 deal between the EU and Turkey to block crossings in the Aegean, Libya has been the gateway for the vast majority of migrants trying to reach Europe by boat, and the area around Sabratha has been the most common departure point.

From July, the number of crossings dropped sharply, a change attributed to increased activity by Libya’s EU-trained coastguard and to the Dabbashi brigade blocking departures in return for offers of amnesty and jobs in the security forces.

Asked whether the Operations Room would stop illegal migration, Abduljaleel said: “God willing we will work on illegal migration after the biggest smuggler has been eliminated.”

The Dabbashi brigade has confirmed the retreat from Sabratha, where the Operations Room took reporters on a tour. Several houses in the main street had been hit by rockets or were burned out but otherwise the city was calm.

Both the Dabbashi brigade and the Operations Room, which was created last year to force Islamic State from Sabratha, have links to the U.N.-backed Government of National Accord (GNA).

Italian officials have visited Sabratha as part of efforts to block migrant flows from there.