In a major setback for ISIS, Jarablus quickly fell. But ISIS may have actually made a tactical retreat—something that, in other parts of Syria, has been followed by asymmetric attacks against advancing forces. Turkey is vulnerable to these attacks inside Syria if it chooses to leave forces behind following the Jarablus operation. ISIS is also capable of continuing its attacks against targets inside Turkey itself.

But while Turkey’s government may blame ISIS for the recent attacks, it has long tolerated the group and the smuggling and recruiting infrastructure it operates within its borders. In repeated public statements, Ankara has also refused to distinguish between terror groups, lumping ISIS together with the Kurdistan Workers’ Party (PKK), the YPG—which Turkey views as the PKK’s Syrian branch—along with followers of Fethullah Gulen, the Pennsylvania-residing, exiled Islamic cleric that President Recep Tayyip Erdogan blames for plotting the failed coup of July 15. According to the Turkish government, all terror threats are one. Turkey’s pro-government media, meanwhile, has taken this one step further, suggesting that Gulen is using both the PKK and ISIS to destabilize Turkey, an assertion resting on the widely held belief in Turkey that the United States controls Gulen.

Erdogan’s ruling Justice and Development Party (AKP), for its part, has wielded this anti-Americanism to deflect questions about its ISIS policy. This strategy may be politically beneficial. But it prevents Erdogan’s government from understanding why the Gaziantep attack happened, and from coming to terms with the permissive climate ISIS operated in for years.

With its eye on Kurdish militancy and creeping Gulenism, the Turkish government did little to control the smuggling of materiel and recruits flooding across its border with Syria, before changing its approach in early 2015. ISIS in Turkey benefits from its proximity to the war-ravaged country: It eases the smuggling of explosives from Syria to Turkey, as well as the group’s ability to purchase goods—like ball bearings—useful for the suicide vests being used to kill citizens in their home country.

Neither the Gaziantep attack nor its target were random—facts that should have been well known to Turkish police. Yunus Durmaz, the man previously believed to be in charge of logistics for the Turkey-based ISIS cell, had identified weddings as a potential target in an electronic file and in emails Turkish police confiscated from his belongings after he blew himself up in a police raid on his apartment in Gaziantep. For years, this ISIS cell has been responsible for smuggling contraband into Syria. The group’s reported former emir, Ilham Bali, used a series of underlings to ferry men and supplies across the border. He placed special emphasis on the procurement and transfer of ammonium-nitrate-rich fertilizer, the primary component in the vehicle-born improvised explosive devices (VBIED) ISIS uses to such devastating effect.