Turkey’s goals have shifted over the course of the nine-year war in Syria as regional and domestic circumstances switched for Turkish President Recep Tayyip Erdogan.
When widespread demonstrations broke out across Syria in the spring of 2011, Mr Erdogan sought to press President Bashar Al Assad, with whom he enjoyed a close relationship, to embrace reform.
However, the violent crackdown on protestors, and Mr Erdogan’s hopes that the regime might be replaced with an Islamist-orientated government, led to Turkey’s support for opposition groups.
While Turkey still voices its anger at Mr Al Assad, Russian and Iranian backing has seen Syrian forces retake most of Syria and ensured his survival.
The north-west province of Idlib remains the final bastion of opposition fighters, including hardline and extremist groups. Turkish troops and their allied militias control northern Aleppo province and parts of northeast Syria, where Kurdish forces also maintain a foothold.
Despite Ankara’s desire to assert its authority on the regional stage, much of its policy in Syria has been driven by domestic factors.
“Turkey’s strategy is more than an exercise in geopolitics – for Erdogan, the war touches on his very political survival,” said Gonul Tol, director of the Turkey programme at the Middle East Institute in Washington.
“In fact, Turkey’s Syria policy has, for years, turned on Erdogan’s ambition to consolidate his one-man rule at home.”
When Mr Erdogan’s Justice and Development Party (AKP) failed to win an outright parliamentary majority in June 2015, it was partly due to the rise of the Peoples’ Democratic Party (HDP), which extended its Kurdish base by appealing to voters in western Turkey.
The AKP adopted a more nationalist stance, abandoning a peace process with the Kurdistan Worker’s Party (PKK) and joining forces with the Nationalist Movement Party (MHP), which virulently opposed negotiations.
The switch led to electoral success the following November and a focus on combating the PKK’s affiliate in Syria, which had established a mini-state along Turkey’s border.
In 2016, Turkey launched the first of three military operations, targeting Kurdish and ISIS forces in Aleppo. The following missions specifically targeted the PKK-linked People’s Protection Units (YPG).
With the YPG largely subdued, attention turned to Turkey’s other Syria-related concern, namely the 3.6 million Syrians living in Turkey that, according to Mr Erdogan, Turkey has spent $40 billion supporting.
As Turkey faced an economic crisis in the summer of 2018, public patience with the refugee population began to wear thin and it became a major political issue.
This led to Mr Erdogan suggesting the resettlement of up to 2 million refugees in former YPG territory, a plan that seems to have withered in the face of international criticism.
The current Syrian government offensive in Idlib has sent civilians fleeing towards Turkey’s border once more, reviving fears of a fresh influx. More than half a million people have been displaced in the last two months, according to the UN.
Turkey has reinforced its troops stationed in Idlib in an apparent attempt to slow the Syrian regime’s advance but at the cost of eight military personnel killed last week alone.
Mr Erdogan, who has called for a territorially united Syria governed by a new constitution, warned that “nothing will be the same” after the attack.