It’s been a bad week for the Islamic State. Along with reports out of Iraq that Iraqi forces have seized the airport in the city of Mosul, Syrian rebels say they’ve wrested back the city of al-Bab from ISIS, which had held the area for three years.

Al-Bab was considered a strategic stronghold for ISIS, connecting militants to nearby Aleppo and the Turkish border all the way to the town of Raqqa and Deir e-Zour in Syria’s east.

Sultan Mourad, head of a Turkish-backed rebel group told AFP that al-Bab was “completely liberated, and we are now clearing mines from residential neighborhoods.” Rebels claimed over 37 ISIS militiats were killed in the fighting, a report confirmed by the Turkish state-run Anadolu news agency.

Social media accounts affiliated with the rebels uploaded videos and images on Wednesday said to have been taken after ISIS fighters left the city early on Thursday.

The mission to re-take al-Bab was part of Ankara’s ongoing operations in northern Syria under Euphrates Shield, aimed at supporting Syrian rebel groups fight the Islamic State in northern Syria and across the Turkish-Syrian border. It was also designed to prevent local Kurdish militias from becoming too powerful and gaining too much territory. According to Turkish media, at least 2,852 ISIS members and 357 Kurdish militants have been killed since the beginning of the operation.

ISIS’ media network Amaq disputed the reports, claiming instead to have killed 400 Turkish soldiers and destroyed 40 tanks. While not admitting to defeat, the group said the battles ended after 104 days of fighting, but did not declare a winner.

A pic from Bab market area, in the old city of Al Bab. pic.twitter.com/hF2lTo7p6O — . (@op_shield) February 23, 2017

The battle against ISIS militants in al-Bab and the first moments after seizing control