Turkey's position on Syria's war has been complex and the best of times, but the battle for Jarablus, which began on Tuesday (23 August), illustrated Ankara's rock-and-a-hard-place position in Syria's bloody five year war.
Its backing of anti-Islamic State rebels in their new push to take the town may be presented as a willingness to take a role in the Syrian conflict, but Turkey has its own reasons for intervening now.
Kurdish rebels of the People's Protection Units (YPG) in northern Syria have been one of very few players with a successful record against Daesh in Syria, which has frightened Turkey given that it is officially at war with the movement's sister group, the PKK.
Now the Kurdish-led and Western-backed Syrian Democratic Forces (SDF) are scoring victories in Syria, taking the town of Manbij from IS, with Jarablus in their sights. Turkey is faced with more Kurdish-led gains on its southern border and has thrown its lot in with Free Syrian Army forces.
It is not all about the Kurds, however, Turkey has also found itself once again the victim of IS terrorism after a horrific attack by a teenage suicide bomber on a wedding in Gaziantep killed over 50 people, many of them children. Ankara can no longer tolerate IS in towns so close to its border.
It is unclear exactly what flag the rebels waiting to take Jarablus are flying under. The Free Syrian Army, once the main anti-Assad group in Syria, is a shadow of the movement it was in 2012 and its role in the war has been largely eclipsed by jihadi forces such as Jabat al-Nusra.
But the Turkish-backed offensive will also put the US in a difficult position. A senior US official told BBC news on Tuesday that Turkey was "trying to create a buffer against the possibility of the Kurds moving forward" and that the US "was working with them on that potential operation."
This at the same time as backing the SDF, which is made up of both Kurdish and Arab rebels and has fought alongside the YPG.
Whatever the alliances however, the movement to take Jarablus will no doubt be welcomed by the town's 11,000 citizens, many of which have lived under IS's violent rule for more than two years.