* Smuggling group which began stopping boats said to have fled
* Migrant crossings had dropped sharply since July
* Clashes led to fears of wider escalation (Updates with comment from Dabbashi brigade, Tripoli government)
By Ahmed Elumami and Aidan Lewis
TRIPOLI/TUNIS Oct 6 (Reuters) - An armed alliance involved in a three-week battle over the Libyan smuggling hub of Sabratha said it had taken control of the coastal city on Friday.
A group 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.
"Sabratha city has been liberated from the militias -- the Dabbashi militias and their alliance," said Operations Room spokesman Saleh Graisia. "Now the city is fully controlled by the Operations Room ... the militias have escaped to the west."
A senior member of the Dabbashi brigade confirmed that its men had retreated. "It is over," he said in a message sent to Reuters. "They took over Sabratha."
The setback for the Dabbashi brigade creates new uncertainty over control of future 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 an amnesty and jobs in the security forces.
The head of the Dabbashi brigade, Ahmed al-Dabbashi, said his men were then targeted by opponents who wanted to continue smuggling. Rivalries in Sabratha are also tied into overlapping political, ideological, tribal and economic differences.
Both the Dabbashi brigade and the Operations Room, which was created last year to force Islamic State militants from Sabratha, have links to the U.N.-backed Government of National Accord (GNA). Since 2015, the Dabbashi brigade has guarded an oil and gas facility west of Sabratha run jointly by Libya's National Oil Corporation (NOC) and Italian firm Eni.
Italian officials have visited Sabratha as part of efforts to block migrant flows from there.
The Libyan National Army (LNA), which has opposed the GNA and is headed by prominent commander Khalifa Haftar, has also claimed ties to the Operations Room, leading to fears that the clashes in Sabratha could lead to a broader escalation of the conflict which developed in Libya after a 2011 uprising.
The LNA is based in eastern Libya but is seeking to expand its reach in the west of the country. Milad al-Zawi, a spokesman for the LNA's special forces, said this week that around 40 of its soldiers had been fighting in Sabratha.
"We hope that Sabratha is a good sign for the LNA," he said on Friday.
The GNA also welcomed developments in Sabratha, expressing "deep satisfaction" and claiming the Operations Room as its own.
The fighting in Sabratha has left dozens dead and injured and has caused extensive damage to residential areas. The city's Roman ruins, which are a UNESCO world heritage site, have also been damaged.
Sabratha's municipal council appealed on Friday for displaced families not to return to their homes until they had been checked for explosives. "The military engineering unit is working to defuse booby traps inside the city," said Operations Room spokesman Graisia.
Additional reporting by Ayman al-Warfalli; Writing by Aidan Lewis; Editing by Richard Balmforth