The world is once again stunned and grieving over a brutal terrorist attack. This time it was in Turkey, where three suicide bombers killed at least 42 people and wounded more than 200 others at the international airport in Istanbul. The timing on Tuesday was especially cruel for a Muslim majority country, coming during the 10 holiest days of the holy month of Ramadan.

The assault, for which Turkish authorities blamed the Islamic State, is the latest evidence of how the chaos in the Middle East, in particular the Syrian war, has metastasized, spilling over borders and rattling countries that are crucial to regional stability. Few are more important than Turkey, a NATO ally and a strategic link with the West. The sharing of intelligence between Turkey and the West, already close, will need to be made even closer.

Though Turkey has been at war with Kurdish separatist forces, this attack, experts agree, was the work of the Islamic State in Iraq and the Levant, or ISIL. The airport symbolizes everything the terrorist group detests, including modernization, international integration and a secular democratic system. A string of attacks and explosions over the last few years, some attributed to ISIL and others to Kurdish separatists, has badly damaged tourism, an important source of income in Turkey.

That Turkey has become a target is not a surprise. For too long, the government in Ankara underestimated the ISIL threat, even as it focused on other groups in Syria trying to overthrow President Bashar Assad.

Turkish officials allowed great quantities of arms and thousands of extremist foreign fighters to pass through its border into Syria. Some of those fighters have found a home in Turkey and are likely to be a threat for some time to come. Meanwhile, President Recep Tayyip Erdogan has allowed a more radical strain of Islam to flourish in Turkey.

It wasn't until last year, under American pressure, that Turkey began carrying out airstrikes against ISIL targets and allowing American aircraft targeting the terrorist group to fly sorties out of Turkey. Turkey also has been more rigorous in shutting down the Syrian border.

ISIL, of course, is not solely Erdogan's problem. The growing threat to Turkey is only the latest reason for the U.S. and its partners to work more urgently to defeat the group in Iraq and Syria, while seeking to end the civil war in Syria, which has not only brought devastation to hundreds of thousands of civilians, but provided fertile ground for extremism.

FROM AN EDITORIAL IN THE NEW YORK TIMES