MOSCOW — President Vladimir V. Putin of Russia has labored for years to weaken NATO, looking for help from President Trump and populist leaders in Europe bent on disruption.
But his boldest and previously most successful gambit to split the United States-led military alliance has been his cultivation of President Recep Tayyip Erdogan of Turkey, NATO’s easternmost member.
That gambit has been threatened by an escalating conflict in northern Syria, which has brought the Russian and Turkish militaries operating there close to hostilities. The two leaders are meeting in Moscow on Thursday in an effort to calm matters, and much is riding on the outcome.
Neither Russia nor Turkey wants an open war, but the meeting is likely to send an important signal about how far the Russian leader is willing to back off in Syria so as to patch up relations and pursue what, in the long term, is the more important Russian goal of dividing NATO.
Russia and Turkey have been on opposite sides of the war in Syria since Mr. Putin intervened in the fighting five years ago, with Russia backing government forces and Turkey their enemies.
Despite that, until the recent flare-up of fighting in the Idlib region, Mr. Putin had managed the tensions and maintained Mr. Erdogan as Russia’s best hope for sowing discord in the NATO alliance.
Mr. Erdogan has delighted Moscow in recent years by feuding openly with Washington, blaming it for an abortive coup against his rule in 2016, spurning its offers of American antiaircraft weapons in favor of the Russian-made S-400 system and joining with Russia in energy projects at odds with Western policy.
But the increasingly close partnership between Russia and Turkey suffered a severe blow last week when Syrian forces backed by Russia killed at least 34 Turkish soldiers in fighting in Idlib Province, the last stronghold of rebels supported by Turkey. Turkey vowed to avenge the bloodshed, shooting down Syrian warplanes and pounding government positions with artillery.
Russia, a nuclear power with global reach, is far stronger militarily than Turkey over all, but it is vulnerable in Syria and needs Turkish cooperation. Turkey has been pounding Russian-backed Syrian forces with artillery and drones from the Turkish side of the border. Russia, hesitant about making an outright attack on NATO territory, has so far refrained from attacking Turkish weaponry inside Turkey.
Mr. Putin has instead gambled that he can again cut a deal with Mr. Erdogan.
As a former K.G.B. agent who was based in East Germany during the Cold War, “Mr. Putin has always been a professional recruiter, and his foreign policy boils down to recruiting leaders,” said Pavel Felgenhauer, a veteran military analyst in Moscow. “Putin has been trying hard to recruit Erdogan and pull Turkey away from the West.”
When mutinous elements in the Turkish military tried to overthrow Mr. Erdogan in 2016, Mr. Putin put in a swift phone call to the Turkish president to offer his support, while American and European leaders dithered. Russia’s quick gesture helped the two leaders put behind them a crisis created in November 2015 by the downing of a Russian warplane by Turkey near its border with Syria. It also helped convince Mr. Erdogan that he should perhaps trust Moscow more than his NATO allies.
Mr. Putin doubled down on his bet on Mr. Erdogan in September 2018 when, at a meeting with the Turkish leader in Sochi on the Black Sea, he agreed, against the advice of his own generals, to hold back Syrian forces from a long-planned offensive on Idlib. The full text of what was agreed in Sochi has never been made public, but the agreement was widely seen as an attempt by Mr. Putin to cement a partnership with Mr. Erdogan that had done so much divide and rattle NATO.
Dmitri Trenin, the director of the Moscow Carnegie Center, predicted that Mr. Putin would “try to keep things on an even keel” with Turkey. But there is now a “sense of disillusionment,” he said, over what the Russian president sees as Mr. Erdogan’s ingratitude in response to Moscow’s previous support.
After the failed 2016 coup in Turkey, he said, “Putin thought this guy is tough and unpredictable and not a nice person to deal with, but I helped him out in a big way and he will remember.” That hope, he added, “has gone now. For Putin, loyalty is the most important thing.”
The current crisis between Moscow and Ankara is particularly difficult to overcome because so much Turkish blood has been spilled by Syrian forces that are armed, trained and often directed by Russia. Nearly 50 Turks have been killed in Syria so far this month as fighting for control of Idlib has gathered pace.
As calls for revenge in Turkey have grown, however, Mr. Putin has sought to calm tempers and avoid a head-to-head conflict. “We are not going to fight against anyone,” he told the Tass news agency in an interview published on Monday. The Kremlin said on Wednesday that Mr. Putin still expected to reach a “common understanding on the crisis” in Syria with Mr. Erdogan.
It did not detail how this might be possible, when Mr. Erdogan has himself been calling for a cease-fire while Russia has insisted that Syrian government forces must clear Idlib of “terrorists.”
But there is still room for a possible compromise. Unlike Syria’s president, Bashar al-Assad, who has vowed to recover “every inch of land” from the rebels, Russia is mostly interested in protecting its military air base at Hmeimim and a naval base on the Mediterranean coast.
Russia has in the past floated the idea of letting the rebels hang on to the city of Idlib under Turkish protection, along with territory up to the border, while Turkey and its rebel allies pull back from two vital highways — the M5, which runs north south from Damascus to Aleppo, and the M4, which runs eastward from the coast toward the border with Iraq — that have been blocked for years because of fighting.
The current tensions between Moscow and Ankara, said Mr. Trenin, have delivered a “severe reality check to the relationship,” but left some hope the two strongmen leaders, each accustomed to getting his own way, can overcome more hawkish members of their military and political establishments to find a face-saving, if only temporary, compromise.
“A bad peace is better than a good fight,” Mr. Trenin said. “Putin, who seems himself and is seen by others as a monarch, sees international relations as the business of monarchs.”
But this approach, he added, only works if the other side has as much unchallenged authority as Mr. Putin does in Russia. “Putin is Russia’s czar and Erdogan would like to be Turkey’s sultan but he is not,” Mr. Trenin said. “He always feels insecure and faces serious opposition in his own country. Putin is basically at ease. He is at the top of his country and far more secure than Erdogan.”