ANKARA – A summit between the Turkish and Russian leaders on Thursday may be the last chance to work out a deal that avoids further calamity in Syria’s northwest.

Faced with mounting losses for his troops in Syria's Idlib province and a potential wave of refugees fleeing the fighting, Turkish President Recep Tayyip Erdogan is eager for a cease-fire, and Vladimir Putin is ready to bargain.

With a looming new migration crisis at Europe’s borders, all eyes will be on Moscow, where the two main power brokers in Syria will see if they can hammer out yet another deal carving up northern Syria, tailored to their own agendas.

Whatever deal they can work out, it will likely bring only a temporary halt in the punishing Moscow-backed onslaught by the military of Syrian President Bashar Assad, which threatens continued suffering for the 3 million people trapped in Idlib.

"The main problem in Idlib is the desire of Assad ... to establish full control of the area and block the border with Turkey, while also having pushed 3 million of the Sunni population, unfriendly to Assad, out onto Turkish soil,” said Vladimir Frolov, an independent Russian foreign affairs analyst.

The fight in Idlib, the last opposition-controlled region of Syria, has already been catastrophic for the population. Nearly a million people have fled their homes since Dec. 1, when the latest government offensive began, in the biggest single wave of displacement since Syria’s civil war began nine years ago. With nowhere to go, many have crowded up against the border with Turkey, which already hosts 3.6 million Syrian refugees and has refused to let new ones in.

It has also brought Turkey, a NATO member, dangerously close to war with Russia.

In the past month, Syrian and Turkish troops have repeatedly clashed on the ground and in the skies, killing scores on both sides. For Turkey, which sent thousands of troops to Syria in the past few weeks, the intervention has been disastrous: 58 Turkish troops killed in the past month, including 33 in one airstrike last week.

Outraged, Erdogan threw open Turkey’s borders with Greece, declaring he would no longer hold back migrants and refugees wishing to go to Europe. Some European leaders have accused him of using refugees to blackmail the West into backing Turkey.

Analysts say the move showed Erdogan’s desperation, especially after failing to get the desired assistance from NATO, and is likely to backfire as dramatic scenes reminiscent of the 2015 migrant crisis play out at the gates of Europe.

“The Turkish side was compelled by necessity in the hope that the pressure created as such would twist Europe’s arm,” said Ahmet Kasim Han, professor of International Relations at Istanbul's Altinbas University

As his isolation deepens, Erdogan is likely to settle for less than what he aspires to at Thursday's talks. Asked about his expectations, he told reporters Tuesday that the main topic will be to “rapidly achieve a cease-fire in the region.”

Moscow, too, appears keen on restoring some kind of status quo in Idlib.

“We expect to reach a shared view of the cause of the current crisis, its consequences and agree on a set of measures to overcome it,” Putin’s spokesman Dmitry Peskov said.

Erdogan and Putin met repeatedly the past few years to coordinate their moves in Syria. In September 2018, they struck a de-escalation deal on Idlib that averted a Syrian offensive. The agreement created a security zone free of heavy weapons and monitored by Turkish troops to halt fighting. But the deal ultimately collapsed.

In October, a deal between the two leaders carved up the zone further east along the border, each deploying forces to fill the void after President Donald Trump’s abrupt order to withdraw U.S. forces there.

Erdogan's top motivation now is to prevent a new wave of refugees into Turkey. His main leverage with Putin is Moscow's desire for strong ties with Turkey to counterbalance U.S. influence in the region.

Putin has signaled Russia’s willingness to accommodate Turkish security concerns. Having already secured Moscow’s interests and those of his Syrian allies by recapturing key cities and securing the country's gas and phosphate reserves, he can afford to appease Erdogan to some extent on Idlib.

After last week's deadly airstrike on Turkish troops, Russia stepped aside to allow Turkish drones and aircraft to pummel the Syrians temporarily, giving Turkey a chance to save face. But on Monday, Russia stepped back in, helping the Syrians to retake the strategic town of Saraqeb, which sits on the main Damascus-Aleppo highway. Russian military police quickly moved into the town, in a clear sign to Turkey not to attempt to retake it.

Soner Cagaptay, director at the Washington Institute for Near East Policy, said the Moscow talks will likely come up with a deal based on the current situation on the ground, reflecting the major gains made by the Syrian government forces — thought it won't be to the liking of Turkey, which wants Assad's forces to roll back.

"Assad will take a good chunk of Syria. Erdogan will end up with a good chunk of the population," he said.

Erdogan wants to return to the boundaries of the 2018 agreement and for Assad to halt attacks. It will be difficult for Russia to say yes to all of these demands. To get that, Erdogan would have to convince Putin that he's risking deep damage in ties with Turkey — or even direct conflict.

Numan Kurtulmus, deputy leader of Erdogan’s ruling party, summed up the president’s thinking in an interview Tuesday with CNN-Turk television.

“The Russians must see that Turkey and Russia have great investments in this region. I don't believe they would want Turkey as a total adversary for the sake of a regime that is on the verge of collapse.”

Han said Erdogan is playing an “escalated game of chicken."

"The fundamental assumption of this brinkmanship is that Russia would not want to enter a conflict with Turkey,” he said.

___

Karam reported from Beirut. Associated Press writers Daria Litvinova and Vladimir Isachenkov in Moscow contributed.