The fighting in Syria is threatening to draw the forces of Turkey, Syria, and Russia into open conflict, making an already volatile situation even worse.

Syrian troops, backed by Russian fighter jets, have recaptured the al-Nairab village in Idlib province from Syrian opposition rebels as the fighting in northwestern Syria teeters back and forth. Meanwhile, Turkish tanks and armored vehicles are pouring into Syria as Turkish President Recep Tayyip Erdogan has made it clear that he’ll do anything to stop the Syrian military from retaking the last rebel stronghold in Idlib.

Turkey wants a say in the post-Civil war Syria, especially since millions of refugees have already poured across the Syrian-Turkish border. Idlib province is home to nearly three million more Syrians, including the rebel forces that Turkey has supported since the civil war began in 2011.

With about four million refugees already inside Turkey, Ankara is worried that an additional one-two million more will pour across the border with nowhere else to go if the Syrians continue their offensive in Idlib. About 700,000 people have already been displaced because of the fighting in Idlib, just since December. That is the most people displaced in that short a time period since the war began nine years ago. 

Erdogan is also finding out that the uneasy agreement with Russia, by which the two sides carved out areas of control, is not going to last. The Russians and Americans had a similar de-confliction agreement in Syria until Russian mercenaries from the Wagner Group “mistakenly” attacked an American base. 

Earlier this month, attacks by Syrian troops from the Assad regime, backed by Russian airpower, attacked Turkish forces and killed 12 Turkish troops. Turkey responded with attacks against the Syrians that killed as many as 50 Syrian troops loyal to Bashar al-Assad. 

On Monday, Syrian artillery units pounded Turkish positions killing five soldiers. Erdogan responded with attacks against Syrian armor and artillery units, while rebels shot down a Russian-made Syrian helicopter. Syrian troops are close to regaining control of the M5 highway that links Aleppo and Damascus. The Syrian government hasn’t controlled the M5 since 2012.

Erdogan has warned the Assad government that it will pay a heavy price for attacks on Turkish soldiers in north-west Syria. He added that the Turkish forces have struck dozens of targets in response.