As the Syrian conflict enters its seventh year, the main players are fighting to carve the country into regions of control and influence.

A pivotal turn came in January, when Turkish forces launched the “Olive Branch” military operation targeting Afrin, a 300,000-strong Kurdish city in northeast Syria.

Three key developments in 2017 led to the Turkish operation in Syria.

The first was Syrian President Bashar al-Assad gaining the upper hand in the conflict. In a major victory over the resistance, Assad forces backed by Russia and Iran captured the Syrian economic powerhouse of Aleppo – with the tacit agreement of Turkey.

Subsequently, Assad forces, and Russia, continued to expand their control over western Syria. In December 2017, they launched an intense attack on Idlib – a city neighbouring Afrin and the last stronghold of Tahrir al-Sham (HTS), an alliance led by the Nusra Front and supported by Recep Tayyip Erdogan’s Turkish government. Even though HTS launched a counteroffensive, the Assad forces continued to make advances in Idlib.

Second was the bold move for Kurdish independence in northern Iraq, which accelerated after the Kurdish and central Iraqi forces recaptured the largest northern Iraqi city of Mosul from Islamic State. In September 2017, northern Iraq’s Kurdish government staged a referendum for independence, with a whopping 93% of Iraqi Kurds voting “yes”. Although the referendum backfired spectacularly, it sent a clear signal to Turkey and others on Kurdish ambitions for independence.

Read more: Mosul is taken back, but Islamic State is not finished yet

Third was the rise in the prominence of Syrian Kurds. In October 2017, the US launched a successful military effort to depose IS from its stronghold, the capital Raqqa, ending IS as a political force. The main proxy army on the ground was the Kurdish-led Syrian Democratic Forces (SDF).

Despite Turkey’s protests, the US supplied SDF with heavy arms, justifying the move as a necessity in deposing the common enemy, IS. Even after the fall of IS, the return of heavy weapons became the focus of a diplomatic crisis between the US and Turkey.

Reuters/Osman Orsal

The last straw for Turkey was the announcement of a 30,000-strong border security force to protect the Syrian Kurdish enclave. Even though the US soon backtracked, it caused outrage in Turkey. This is because the border in question was the Turkey-Syria border, and implied the security force was aimed at Turkey.

Erdogan called the proposed force a “terror army” and wowed to “nip this terror army in the bud”. Within days, the Turkish military operation had begun.

This move came at the same time as a break-up of the uneasy alliance between Turkey, Russia and the Assad regime, as well as the US, over the future of Syria. Erdogan signalled this in late December, when he accused Assad of “state terrorism”.

What America wants

For the US, Turkey’s presence in Syria complicates things, and harms its plans resting on the territory controlled by Kurdish forces. Just as there was no need for Turkey during the offensive against IS, there is no need for Turkey in the future of Syria.

The US sees the UN-led Geneva talks as the solution to the Syrian crisis and insists that Assad is not part of the solution. This goal is becoming increasingly unlikely. Realising this after Assad’s Aleppo victory, the US has shifted its objectives to eliminating IS and supporting an increased Kurdish prominence in Syria.

Read more: After Islamic State falls, we should expect aftershocks in Syria

According to Defence Secretary James Mattis, the US will continue its presence in Syria, but as a “stabilising force”. Secretary of State Rex Tillerson confirmed this, adding that the continued US presence aimed to prevent Iran and Assad forces regaining territory “liberated with help from the United States”.

This is a major policy shift by the US administration and has infuriated Erdogan. It means US protection for the Kurdish enclave is permanent, and the US will try to neutralise Russian influence by controlling regions lying east of the Euphrates River. It will also use Kurdish forces and populations as a bargaining chip in any discussion of Syria’s future.

What Russia wants

Turkey’s Afrin operation would not have been possible without Russian approval, as Russia controls the air space in northwestern Syria.

Russia has allowed the operation to go ahead so that it can maintain the fragile alliance that President Vladimir Putin formed with Iran and Turkey, and continue the recent talks Russia led with Syrian factions in Sochi. Russia wants to preserve the hard-won influence it garnered over the past two years and avoid tarnishing its world power status. More importantly, Putin does not want anything to overshadow his bid to win the looming presidential elections on March 18.

Putin has seen Erdogan as an important ally in his strategy to divide the NATO alliance from within, and so would prefer he stayed in power. This is why Putin gave Erdogan a political hand in allowing the Turkish operation to go ahead. In a sense, Putin can tolerate the Afrin operation for as long as it is contained to a small region.

What Turkey wants

Erdogan’s main aim with the operation is to thwart any US and Russian plans to carve up Syria after the IS defeat.

Reuters/Umit Bektas

Turkey insists on being involved in every key negotiation on the future of Syria, to prevent the establishment of a semi-autonomous Kurdish region, which it sees as an existential threat. Having its own 8-10 million Kurdish population in the southeast of the country, Turkey feels it is next on the list of destabilised countries and fears it is only a matter of time before its Kurdish region is excised for a greater Kurdish state.

Turkey wants to establish itself as the third major player after Russia and the US by supporting the Free Syrian Army, the least-powerful Syrian faction composed of Sunni Arab forces. In doing so, it wants to establish a Turkish-controlled corridor north of the Euphrates so that it can move 2.8 million increasingly unpopular Syrian refugees out of Turkey. The speed of the military operation suggests pre-planning rather than a reaction.

Ultimately, Erdogan is playing for internal politics. He needs the support of the nationalist elements in Turkey to win the critical 2019 presidential election, which will give him new powers passed in the 2016 referendum.

Losing the election would mean his political opponent has those powers, and would likely resurrect serious corruption charges against him. While those charges may be forgotten in Turkey for now, they are kept alive in US courts.

This explains Erdogan’s increasing anti-US rhetoric. He is counting on the Syrian operation to increase his bargaining chips in a potential showdown with the US administration.

Turkey has made an extremely risky move, which could escalate the conflict in Syria. Over the past three decades, it has launched countless operations across the Iraqi and Syrian borders. Not only has Turkey failed to prevent developments favouring a pathway towards Kurdish independence, it has made matters worse for itself. This time may be no different.