One success of Russian foreign policy in recent years has been a remarkable improvement in relations with Turkey, historically a regional rival with which it fought multiple wars. So why Russia would put those gains at risk to start flying combat aircraft into Turkish airspace takes a bit of explaining.

It was only on Sept. 23, just days before Russia launched its air campaign in Syria, that President Recep Tayyip Erdogan was in Moscow to open a new mosque with his friend Vladimir Putin. Erdogan lauded the way trade between the two countries had risen to $31 billion last year — in 2002, the year Erdogan’s Justice and Development Party won power, that figure was $5 billion. The Turkish leader set a target of $100 billion by 2020.

In April, contractors broke ground for a nuclear plant on Turkey’s coast, a $20 billion Russian contract. Last year, the two countries agreed to build a pipeline taking up to 63 billion cubic meters of Russian gas to Europe each year. Several times over the last two years, Erdogan has talked with Putin about joining the Shanghai Cooperation Organization, the security body Russia formed with China and four Central Asian states.

In response to the aircraft incidents, Erdogan has now warned Russia it could lose Turkey as a friend and natural gas customer, and highlighted his country’s membership in NATO. On Thursday he said he might find someone else to build that nuclear plant. A day earlier, Russian natural gas giant Gazprom said the TurkStream gas pipeline project was being postponed.

There are several possible reasons why Russia would risk jeopardizing this relationship by flying jets into Turkish airspace (Russia says these were accidents, but neither Turkey nor NATO find that credible). The first is that having entered the Syrian war on the side of President Bashar Assad, Russian leaders know the Turkish government will be alienated anyhow. It is on the other side in this conflict, and few have staked as much on Assad’s fall as Erdogan.

Yet that explains only why Russia would feel less need to be wary of Turkish sensibilities, not why it would to do something as deliberately provocative as locking radar onto Turkish jets on the Turkish side of the Syrian border.

Russia probably has a concrete and parochial goal: forestalling Turkish plans to create safe zones in Syria.

The best response to Putin’s latest military adventure would be to establish areas in the north and south of Syria, in which refugees and militants belonging to the acceptable Sunni opposition to Assad — those groups that could be part of any political settlement — would be protected. This would involve establishing no-fly zones, limiting Russia’s field of action in the air and on the ground.

Turkey and Jordan have long proposed such buffer zones, and Erdogan was pushing his case again on a trip to Brussels this week. Safe zones would lock down parts of Syria, making Assad’s further pursuit of the war less valuable because the territory could not be reclaimed. The zones could also begin to relieve Syria’s humanitarian and refugee crisis, which has reached Europe in earnest this summer.

Russia’s military support for Assad has already done something similar on the other side: With so much Russian prestige at stake, Assad isn’t getting driven out of Damascus any time soon. With little purpose in continued fighting on either side, a settlement based on a Bosnia-style federalization of Syria would be the logical outcome.

Putin, however, is obsessively wary of NATO no-fly zones. In Libya, where Russia agreed to let a Western alliance establish one under a United Nations resolution in 2011, it was used not just to protect civilians but to provide air support to rebels, who then toppled Moammar Gadhafi, a Russian ally. The same might happen in Syria — certainly that’s what Erdogan would want. So when Turkey’s aging F-16s are buzzed by state-of-the-art Russian SU-30s, the message is: Don’t even think about trying to set up a no-fly zone in Syria.

I don’t believe that Putin is prepared to launch a hot war with NATO or Turkey over Syria. Outnumbered, outgunned and far from home, Russian assets in Syria would be hugely vulnerable. Russia’s otherwise bizarre decision to fire ship-borne cruise missiles into Syria from the Caspian Sea seems designed to paper over that weakness.

Putin compensates for his relative lack of military resources by making it clear that he is far more ready to take risks than NATO, Turkey or the U.S. He appears determined at least to help Assad continue the war until he possesses all of the territory he would want to receive under any eventual settlement. Imposing a no-fly zone now isn’t impossible, but it would require calling Putin’s bluff, a showdown that U.S. President Barack Obama is unlikely to risk.

Whether Putin is serving his own best interests is another matter. Paradoxically, his Syrian goals would be best served by cooperating in the creation of safe zones. With Russian jets and commanders involved, he could ensure they weren’t abused. The relationship with Turkey would no longer have to be sacrificed. Europe would overflow with gratitude for Putin’s help in reducing, or even reversing, the flow of refugees.

The U.S. would be only too pleased to support the settlement process that followed, at which point Putin might even get the global alliance with Assad to defeat Islamic State that he says he wants. He would be seen as the man whose decisive intervention brought this terrible war to an end.

As it stands, the net effect of Russian airstrikes is more likely to be that Saudi Arabia, Turkey and others pump more anti-tank — and perhaps anti-aircraft — weapons into the hands of whichever rebels are most effective against Assad, including al-Qaida’s al-Nusra Front. Assad may recoup some territory, but the war will grind on, “moderate” rebel forces will join stronger groups such as al-Nusra, and the basis for any eventual settlement will grow more elusive.

Marc Champion writes editorials on international affairs.

KEYWORDS Russia, Syria, Erdogan, Turkey, Putin, Assad