MOSCOW (AP) — The Turkish and Russian presidents today sat down for talks in Moscow aimed at ending hostilities in northwestern Syria involving their forces along with proxies that threaten to pit Turkey against Russia in a direct military conflict

Before the latest crisis, President Vladimir Putin and his Turkish counterpart President Recep Tayyip Erdogan had managed to coordinate their interests in Syria even though Moscow backed Syrian President Bashar Assad while Ankara supported its foes throughout Syria’s nine-year war. Both Russia and Turkey appear eager to avoid a showdown, but the sharply conflicting interests in Idlib province make it difficult to negotiate a mutually acceptable compromise.

Both leaders underlined the need to reach agreement at the start of the Kremlin talks. Putin said they they need to work out steps to end fighting and prevent damage to bilateral relations. Erdogan also voiced hope for finding a settlement and pointed at blossoming Russia-Turkey trade.

A Russia-backed Syrian offensive to regain control over Idlib — the last opposition-controlled region in the country — has pushed nearly a million Syrians toward Turkey. Erdogan responded by opening Turkey’s gateway to Europe in an apparent bid to coerce the West to offer more support to Ankara.

Turkey has sent thousands of troops into Idlib to repel the Syrian army, and clashes on the ground and in the air that have left dozens dead on both sides. Russia, which has helped Assad reclaim most of the country’s territory, has signaled it wouldn’t sit idle to see Turkey rout his troops.

Putin offered his condolences to Erdogan over Turkish losses in a Syrian airstrike, but noted that Syrian troops also suffered heavy losses.

“We need to discuss the situation to prevent any such incidents and also not to damage Russia-Turkey relations that we cherish,” the Russian leader said.

“The world’s eye are on us,” Erdogan said. “The steps we will take, the right decisions we will take here today will help ease (concerns in) the region and our countries.”

Just before sitting down with Erdogan, Putin discussed the situation in Idlib with European Council head Charles Michel who met the Turkish president in Ankara on Wednesday. The Kremlin said Michel informed Putin about the EU’s efforts to block the flow of migrants.

After Turkey had downed several Syrian jets, Moscow warned Ankara that its aircraft would be unsafe if they enter Syrian airspace — a veiled threat to engage Russian military assets in Syria.

Russian warplanes based in Syria have provided air cover for Assad’s offensive in Idlib.

Opposition activists in Idlib blamed Russian aircraft for today’s strike on a rebel-held village which they said killed at least 15 people, including children, and wounded several others. The Russian military had no immediate comment on the claim, but it has staunchly denied similar previous claims insisting it hasn’t targeted residential areas.

The fighting in Idlib comes as the most severe test to Russia-Turkey ties since the crisis triggered by Turkey’s downing of a Russian warplane near the Syrian border in November 2015. Russia responded with an array of sweeping economic sanctions, cutting the flow of its tourists to Turkey and banning most Turkish exports — a punishment that eventually forced Turkey to back off and offer apologies.

Turkey can’t afford a replay of that costly crisis, far less a military conflict with a nuclear power, but it has a strong position to bargain with. Moscow needs Ankara as a partner in a Syrian settlement and Russia’s supply routes for its forces in Syria lie through the Turkish Straits.

Moscow also hopes to use Ankara in its standoff with the West. Last year, Turkey became the first NATO country to take delivery of sophisticated Russian air defense missile systems, angering the United States. Turkey has put its deployment on hold amid the crisis in Idlib.

The talks in Moscow will mark the 10th encounter in just over a year between Putin and Erdogan, who call each other “dear friend” and have polished a fine art of bargaining.

Last October, they reached an agreement to deploy their forces across Syria’s northeastern border to fill the void left by President Donald Trump’s abrupt withdrawal of U.S. forces. Prior to that they had negotiated a series of accords that saw opposition fighters from various areas in Syria move into Idlib and in 2018 carved out a de-escalation zone in Idlib.

They blamed one another for the collapse of the Idlib deal, with Moscow holding Ankara responsible for letting al-Qaida linked militants launch attacks from the area and Turkey accusing Moscow of failing to rein in Assad.

A possible compromise on Idlib could see Assad retain control over the key M5 highway, which his forces claimed in the latest offensive. The road that spans Syria linking Damascus with Aleppo, the country’s commercial capital, is essential for Assad to consolidate his rule.

In a sign that the Kremlin firmly intends to secure control of the M5, earlier this week Russian military police have deployed to a strategic town of Saraqeb sitting on the highway to ward off any Turkish attempt to retake it.

In return, Putin could accept the presence of Turkey-backed militants in the areas alongside the border and put brakes for now on Assad’s attempts to claim full control over Idlib.