Syrian President Bashar al-Assad's certain victory in an election next month, derided internationally as a charade, leaves Turkey facing a bitter truth - its assumption of his quick demise was a costly miscalculation. With al Qaeda-linked armed groups controlling patches of territory across Turkey's southern border and a registered refugee influx set to top a million within months, Syria's three-year old war presents Ankara with an increasing financial burden and a growing security threat.
A gun battle in March when special forces raided the suspected Istanbul hide-out of an Islamist militant group active in Syria highlighted the potential threat to Turkey from the thousands of foreign jihadis who have been drawn into the conflict, a portion of them entering Syria over the Turkish border.
The torching of a building housing Syrian refugees in Ankara this month meanwhile pointed to anger at the growing social and economic costs of a humanitarian response which has already cost Turkey close to $3 billion. With Assad facing no serious challenger in a June 3 election which his Western and Arab foes, as well as the Syrian opposition, have dismissed as a parody of democracy, such tensions are unlikely to dissipate any time soon.
"We may describe Turkish Syria policy as a mess. We've committed too much, we've talked too big," said Osman Bahadir Dincer, Syria expert at the Turkish non-partisan thinktank USAK. "At the very beginning Turkey underestimated the humanitarian problem. Turkey was not prepared and I think the same can be applied to border security."
Prime Minister Tayyip Erdogan initially believed his stature in the Middle East and relationship with Assad might enable him to steer the Syrian leader away from conflict. In the early stages of Syria's uprising in 2011, Erdogan called on Assad to learn the lessons of the Arab Spring and step down. Erdogan took Assad's failure to heed his advice as a personal affront, some of those close to him say, and within two years he was leading calls for international military intervention to end his former ally's rule.
"Turkey's Syria policy has shown the limits of its influence in the Middle East," said Fadi Hakura, Turkey expert at the London-based think tank, Chatham House. "It is a clear sign to the US and other partners that Turkey is an important player but not a rising star in the region." After Syria announced in April that it would hold polls, Turkey was quick to dismiss any election as "null and void". Foreign Minister Ahmet Davutoglu this month accused Damascus of "mocking the world" by organising the vote.
Syria's authorities have not said how they will hold the vote in a country where six million people have been displaced and swathes of territory are outside government control. Assad's forces have consolidated their grip around Damascus and central Syria, and hold the Alawite heartland provinces on the Mediterranean coast. Rebels control much of the north and east, but have been plagued by infighting. Turkey is struggling to cope with the spillover.