Ten years ago, Recep Tayyip Erdogan, then prime minister of Turkey, hosted Syria's President Bashar al-Assad for a family holiday in the Aegean resort of Bodrum as relations between Turkey and Syria soared to new heights.

After decades of Cold War animosity, the Erdogan government that took power in 2002 had built new ties with its southern neighbour and trade and diplomatic ties flourished.

Much of this rapprochement was underpinned by the personal friendship of the countries' leaders as Erdogan and Assad jetted back and forth on amicable visits.

Since then, the eruption of Syria's bloody war has seen a cataclysmic split between the two as Turkey seized on the Arab Spring uprisings across North Africa and the Middle East in support of popular dissent.

While ordinary Syrians, many of them Sunni Muslims who felt excluded by the Alawite government, took to the streets in 2011, Erdogan counselled Assad to listen to the demands of demonstrators.

Security forces reacted with brutality to the protests and Erdogan's rhetoric against his one-time friend rose accordingly, culminating in the Turkish president dubbing Assad a "terrorist involved in state terrorism".

"He took it personally when he advised Bashar not to overreact to the protesters and his advice wasn't taken," said Joost Hiltermann, the Middle East and North Africa programme director at the International Crisis Group.

"Of course, because it was given from a friend to a friend, Erdogan no doubt took it personally. Something was broken."

Over the course of the eight-year conflict, Turkey has backed rebel groups against the Syrian government, with Erdogan insisting there could be no political solution in Syria while "the president of a Syria who killed close to one million of its own citizens" remained in power.

Shifting focus

Turkey, like many regional and Western powers, called for Assad's removal but when Russia came to the aid of its old ally in September 2015 the tide turned in Assad's favour.

As the West and others quietly retreated from their demands for Assad to step down, Turkey continued to voice its opposition but its focus shifted to what it saw as a more immediate security threat; the Kurdish People's Protection Units (YPG).

The group is closely aligned to the Kurdistan Workers' Party (PKK), which has fought the Turkish state since 1984. By 2015, the YPG had carved out a large chunk of territory in northeast Syria along the border with Turkey.

In the summer of that year, the fight with the PKK in Turkey's southeast re-erupted with a ferocity not seen since the 1990s, further underlining the threat.

While Ankara has not backed down from its hostility to Assad, the rhetoric has been toned down as the fight against the YPG has taken centre stage.

In February, when Turkey was in the process of ousting the YPG from its northwestern stronghold in Afrin, the pro-government Yeni Safak newspaper called for ties with Syria to be re-established.

During a trip to Moscow on Wednesday, Erdogan said Turkey's "sole purpose" was to fight groups such as the Islamic State in Iraq and the Levant (ISIL, also known as ISIS) and the YPG.

And last month, Turkish Foreign Minister Mevlut Cavusoglu said Turkey would consider working with Assad if he won a democratic election.

Assad has seen off his enemies and the threat of regime change, said Kamal Alam, a Syria analyst.

"Turkey has made statements that if Assad won an election it would work with him," he said. "Turkey has no option but to work with Assad. That's a U-turn."

Cavusoglu's comments on Assad came days before the US announced its withdrawal from northeast Syria, where its troops had been coordinating with the YPG in the battle against ISIL.

This has led the YPG to seek a deal with Assad as Turkish tanks and troops on the border threatened its territory.

Russian President Vladimir Putin has backed dialogue between the YPG, which is seeking to retain its autonomy in a new federal Syria, and Damascus.

Were Assad to regain control over northeast Syria, Turkey hopes the YPG threat would be reduced if not eliminated.

"For the Syrian regime, which doesn't want any kind of autonomy for anyone, that would mean the return of Syrian security agencies so the YPG, while it may still exist, wouldn't be in the same form and couldn't threaten Turkey," Hiltermann said.

Alam, a visiting fellow at London's Royal United Services Institute, said Turkey's goals had "changed drastically" since the start of the war.

"At the moment all they can achieve is getting their border safe and making sure the YPG is not a threat," he said.

The Moscow meeting also saw Erdogan and Putin mention a 1998 agreement between Turkey and Syria that saw the latter expel PKK leader Abdullah Ocalan and close the group's camps.

190123084117070

Cavusoglu later described Putin's reference to the treaty, which says Syria will not allow any activity from its territory that threatens Turkey's security, as a "positive for us".

Despite the personal animosity between Assad and Erdogan, Putin could play a role in getting them to work together, said Mitat Celikpala, an international relations professor at Kadir Has University in Istanbul.

"Erdogan is smart enough that he can put personal feelings aside if he sees a political advantage. No one can say that Erdogan will never get together with Assad," he added.

Irrevocable break

Post-conflict relations between the two powers will largely depend on the shape of the government in Damascus after presidential elections in two years.

According to Alam, the make-up of the administration is likely to be similar to the current government, possibly with the inclusion of some "heavily vetted" opposition figures.

190126161734654

As for Turkey's attitude to a post-war Assad government, Sener Akturk, author of Turkey's Role in the Arab Spring and the Syrian Conflict, said Turkey may not recognise its legitimacy but would have to accept it, much as it does the Greek-Cypriot government, Armenian control of Nagorno-Karabakh and Israel's occupation of East Jerusalem.

"Turkey, both before and under Erdogan's governments, came to terms with these de facto outcomes ... but does not recognise any of them as legitimate," he said.

Another question in post-war Syria will be what happens to the territory that Turkey controls in northern Syria following two operations that saw it back the Free Syrian Army against ISIL and the YPG.

The area, which runs along the Turkish border from Afrin to the River Euphrates, could be used as "bargaining chips" to strengthen Ankara's hand as it seeks to neutralise the YPG, according to Hiltermann.

As for the relationship between the Turkish and Syrian presidents? Most observers feel the once-close ties between Erdogan and Assad have been damaged beyond repair.

"The relationship was broken after the Assad regime launched its policy of mass murder and mass deportations and, as such, this break seems to be irrevocable," Akturk said.