Since September 16, tensions have shot up along Turkey’s border with the area around Ayn al-Arab, a city inhabited by Syrian Kurds. The trigger was a massive attack by Islamic State troops equipped with heavy artillery and armor against the town, which is known in Kurdish as Kobane.

Three days later, Syrian Kurds started fleeing to the border, telling of massacres in the villages surrounding Ayn al-Arab. After initially keeping the border closed, the Turkish authorities opened it on the morning of September 20, and some 130,000 refugees entered Turkey in less than forty-eight hours—a record number since the beginning of the Syrian revolution in March 2011.

The situation became even more confused when the Islamic State released 46 Turkish hostages and brought them to the Syrian border town of Tell Abyad. At a press conference on September 21 before leaving for the UN General Assembly, Turkish President Recep Tayyip Erdoğan declared that the hostage release was based on a “political, diplomatic bargain” with the jihadists.

Meanwhile, Turkish Kurds, having heard about the attack, started flocking to the Syrian border to join the Kurdish People’s Protection Units, a Syrian-Kurdish defense corps fighting the Islamic State. This prompted Turkey to close the border again on the morning of September 21. The UN predicted that hundreds of thousands of additional Syrian refugees could be on their way to Turkey.

In short, it is mayhem at the Turkish border. This chaotic situation raises three urgent questions.

First, is Turkey treating the Islamic State as a terrorist organization or as a diplomatic interlocutor? Although the Turkish authorities are unlikely to reveal much, Turkey’s NATO allies are eager to learn what Ankara’s “political, diplomatic bargain” with the Islamists might have entailed.

Some sources have reported that scores of Islamic State prisoners held by Turkey were released at the same border crossing where the 46 Turkish hostages were set free. While not unusual in the region, hostage-prisoner swaps do not tend to fall under “diplomatic” operations—especially since the Islamic State, despite its name, is not a state.

The second question is: Can Turkey and the recently formed coalition of allies against the Islamic State ignore a massive ethnic-cleansing operation on the border of a NATO member, almost within sight of Turkish soldiers? If Ankara and others do choose to react, this raises two further queries: whether Turkey will be willing to engage combat troops against the Islamic State, and whether Ankara will allow the anti–Islamic State coalition to launch military operations out of Turkish territory.

Based on recent experience, Turkey is unlikely to deploy its own soldiers. And given the extreme geographical proximity of the Islamic State’s activities to Turkish soil, it is doubtful that aerial bombardments alone would have any real efficacy. In his remarks on September 21, President Erdoğan left the door open for discussion on these issues, albeit in general terms.

The third question is an even trickier one: How will Turkey deal with the humanitarian crisis unleashed by the Islamists? The type of combat operations undertaken by the Islamic State in Ayn al-Arab—but also in other border towns such as Azaz and Bab al-Hawa—massively increases humanitarian needs at the Syrian-Turkish border and in Turkey. At the same time, there is a higher security threat against Turkey itself—not counting the effects on Turkish Kurds when attacks occur on their Syrian counterparts.

The threat at the border does not come directly from the Islamic State as an organization, which would hardly risk a frontal attack on a NATO country, but from individual operatives traveling from Syria and Turkey to Western Europe. This has now become a distinct risk, and the mayhem is therefore no longer just a bilateral affair between Turkey and the Islamic State. Rather, European countries and the United States become involved as they assume two key responsibilities: ensuring that no more jihadists enter Syria or try to reach Turkey and Western Europe; and assisting Turkey in its humanitarian efforts.

Ankara has already made impressive progress since the start of the Syrian revolution in addressing the humanitarian challenges it faces. But so far, Turkey’s inclination has been to try to cope with such issues on its own. Given the current parameters, this approach is no longer sustainable. That is not just because of the humanitarian burden itself; it is also because the security of the EU and the United States—besides that of Turkey—is at stake around the southern Turkish towns of Ceylanpınar, Akçakale, Suruç, Karkamış, Öncüpınar, and Cilvegözü.

How Turkey will handle legitimate requests for cooperation from European countries and the United States and whether Ankara will accept their offer of humanitarian and counterterrorism support are now the real issues. Whatever “political, diplomatic bargain” was struck between Turkey and the Islamic State in recent days, Turkey’s pressing challenge is to show genuine, seamless cooperation with its Western allies.