Turkey is in mourning. Last week, in a small village in the province of Idlib, in northern Syria, a Turkish military convoy was targeted by several Russian and Syrian regime planes in a coordinated attack that lasted hours. Ambulances were hit and medevac helicopters were prevented from evacuating Turkish casualties because Russia controls the air space. We lost more than 30 young men.

What was once an unfolding humanitarian crisis is now a full-blown conflict, and recent weeks have shown the terrible consequences of the West’s unwise decision to turn a blind eye to the inferno in Idlib, Syria’s last rebel-held territory, for months. Before the attack, Idlib’s unfolding crisis saw 900,000 internally displaced Syrians moving to the Turkish border regions since the start of the Syrian regime offensive to conquer the area three months ago. Now, the province is in a state of open war (two Turkish soldiers were killed Wednesday) involving not just Turkey, Russia and Syria, but also Europe and possibly Iran.

In retaliation for the killing of its soldiers, Turkey has been targeting Syrian troops and facilities, hitting pro-Iranian militias fighting on behalf of the Bashar al-Assad regime along the way. As the long-standing proxy fight between Turkey and the Syrian regime has morphed into a direct war, Ankara is asking for Western military support. But neither NATO nor the United States is willing to get entangled and risk a direct confrontation with Russia. Europe has also been slow to react to the humanitarian crisis. Frustrated, Turkey has announced that it will let refugees cross into Europe. Now thousands of refugees who had been living in Turkey are lining up on Turkish shores and borders hoping to reach European soil. It’s all a dangerous mess.

The West can no longer afford to look away. Leaders must act decisively.

Turkish President Recep Tayyip Erdogan is flying to Moscow on Thursday to meet with Russian President Vladimir Putin. In its official accounts, Ankara has been careful to hide the Russian fingerprints in the attack on its forces, putting the blame squarely on the Syrian regime. This lacks credibility but allows for diplomacy.

Europe and the United States have ample reason to resent Erdogan’s frequent anti-Western tirades, but a Turkey in conflict with Russia and Iran would ultimately drag in more powers and upset the balance of power on the fringes of Europe. It is in everyone’s interests for Erdogan to negotiate a cease-fire in Moscow and a realistic north-south partition plan for Idlib along the main highways that cut across the province. The north, which borders Turkey, could be a safe zone for refugees.

President Trump and German Chancellor Angela Merkel should push Putin to agree to this outcome. Some European politicians have called for new sanctions on Russia over Idlib. But if we have learned anything in recent years (see Ukraine), it is that Russia is not deterred by sanctions or pleas about human suffering, as my colleague Julien Barnes-Dacey recently argued. Recognizing Russia’s position in Syria and dangling the possibility of future financial aid for its reconstruction is the way to go.

Russia has certainly been instrumental in propping up a regime that massacres its own people. But Slobodan Milosevic had Bosnian blood on his hands when he signed the Dayton peace accords to end the war. For now, saving lives and averting an international quagmire seem more important than preserving a sense of moral purity.

More urgently, Washington must use its existing channels with the Russians in Syria to ask for de-escalation. While Pentagon officials have made clear that the United States will not get involved in a new front against Russia or Syria over Idlib, or enforce a no-fly zone, they should do more, and do so publicly, to demonstrate to the Turkish public that their country’s interests lie in staying within the Western alliance, not in seeking an unstable partnership with Russia.

In return, Washington can ask for greater suppression of Hayat Tahrir al-Sham, an al-Qaeda offshoot in Idlib that controls parts of the province and is now forming the backbone of Syrian opposition forces fighting the regime.

For refugees, Turkey and Europe need to sit together to hammer out a new financial arrangement to build on the 2016 migration deal. They also need to start thinking in the longer term about reconstruction in Idlib. Europeans have given plenty to support humanitarian aid but remain steadfast about not supporting reconstruction as long as the Assad regime is there. At this point, this seems like a luxury the European Union can no longer afford.

It is certainly ironic that last fall Erdogan teamed up with Russia to kick U.S. forces out of eastern Syria only to turn around a few months later and seek U.S. support against Russia. Erdogan’s impetuous foreign policy has isolated Turkey to such an extent that he now finds himself fighting Russia, Iran and Syria and abandoned by Europe and Washington. But now is not the time to revel in Erdogan’s missteps — keeping Turkey stable and within the Western alliance is more important than settling scores with Erdogan.

Read more: