There is much more at stake for Turkey in Idlib than a potential influx of thousands more Syrian refugees.
A government takeover of the last major rebel-held province could bring into question Turkey’s relevance to the Syrian conflict and jeopardise its presence in the country.
Turkey controls a significant amount of territory to the north of Idlib.
It has managed to secure that territory over the last couple of years by successfully using its leverage with the rebels in negotiations with Russia and Iran, the Syrian government’s two key allies.
In 2016, Turkey stood by as Russian-backed pro-government forces besieged rebel-held eastern Aleppo. In return, it got the go-ahead for an offensive by Turkish-backed rebels against the Islamic State group in Jarablus and al-Bab.
And towards the end of 2017, Turkey pushed Islamist rebels in Idlib to co-operate with a de-escalation agreement it had negotiated with Russia and Iran. Russia later allowed Turkish-led forces to drive Kurdish fighters out of Afrin.
If the rebels in Idlib were to be defeated, Turkey would not only lose a major bargaining chip, but Turkish-controlled areas might be next in line in the government’s campaign to recover “every inch” of Syria.
In Tehran on Friday the Turkish, Iranian and Russian presidents held a joint news conference that demonstrated they agreed to disagree on Idlib.
The three men were united in one cause only – criticism of the US military presence in Syria and its support for an alliance of Kurdish and Arab militias called the Syrian Democratic Forces (SDF), which controls about a third of the country.
A Syrian government offensive in Idlib would test the limits of co-operation between Turkey and Russia.
Although they have contradictory objectives in Idlib, Russia may still want to keep Turkey on side, rather than have it become a disruptive force, says Galip Dalay, research director of the Istanbul-based Al Sharq Forum.
However, Turkey’s leverage over Russia and Iran is limited.
Turkish President Recep Tayyip Erdogan has proposed postponing the government offensive on Idlib or limiting it to target only Hayat Tahrir al-Sham (HTS), an al-Qaeda-linked jihadist movement once known as al-Nusra Front.
A week before the Tehran summit, the Turkish government designated HTS as a terrorist organisation, in line with the United Nations and the US.
What complicates the matter is that the Turkish military has 12 observation posts along the frontline in Idlib, deep in HTS territory.
The observation posts, which were reportedly reinforced in the last couple of weeks, were established last year with the tacit agreement of the group.
HTS controls more than 60% of Idlib, including the province’s border crossing with Turkey, Bab al-Hawa.
Ankara has kept communication channels open with the HTS while also backing a rebel umbrella group set up to counter the jihadists, the National Liberation Front.
The NLF, which includes hard-line Islamist groups and factions affiliated to the Free Syrian Army, was engaged in deadly clashes with HTS earlier this year. But it has signalled that it is ready to co-ordinate with its rival to repel a government offensive.
Another rebel alliance based outside Idlib called the National Army, which is armed and directly controlled by Turkey, has also expressed an interest in merging with the NLF, further complicating the picture.
A day after the Tehran summit, President Erdogan said Turkey would not watch from the sidelines while an assault on Idlib took place. But its options are limited.
Turkey is expected to try to shelter the hundreds of thousands of people who could flee an offensive inside Turkish-controlled Syrian territory, rather than allow them to cross its border and add to the 3.5 million refugees it already hosts.
A Turkish source in Idlib says the predominantly Sunni Arab civilians and rebels could be relocated to Afrin, which would fit into Turkey’s attempts to change the demography of the Kurdish majority region.
Turkey is also wary of the Kurdish People’s Protection Units (YPG), which it forced out of Afrin earlier this year, accusing it of being an extension of the banned Kurdistan Workers’ Party (PKK) that has fought for Kurdish autonomy in Turkey.
Kurdish leaders in Syria say they believe that a change in political circumstances in Syria might create an opportunity for them to carry retake Afrin.
Some reports suggest the YPG may participate in the government offensive in Idlib.
More likely though is a YPG attack on Afrin that coincides with the start of the government’s operation.
Turkey has benefited greatly from the status quo in Idlib over the last two years.
But it appears that it will suffer a significant blow whichever way an offensive on Idlib unfolds.