The relationship hinted at by Russian leader after warplane was shot down is a complex one, and includes links between senior Isis figures and Turkish officials

Since the earliest months of the Syrian war, Turkey has had more direct involvement and more at stake than any of the regional states lined up against Bashar al-Assad.

Turkish borders have been the primary thoroughfare for fighters of all kinds to enter Syria. Its military bases have been used to distribute weapons and to train rebel fighters. And its frontier towns and villages have taken in almost one million refugees.

Turkey’s international airports have also been busy. Many, if not most, of the estimated 15,000-20,000 foreign fighters to have joined Islamic State (Isis) have first flown into Istanbul or Adana, or arrived by ferry along its Mediterranean coast.

The influx has offered fertile ground to allies of Assad who, well before a Turkish jet shot down a Russian fighter on Tuesday, had claimed Turkey had enabled or even supported Isis. Vladimir Putin’s reference to Turkey as “accomplices of terrorists” is likely to resonate even among some of Ankara’s backers.

Putin calls Turkey 'accomplices of terrorists' after Russian jet shot down - live updates Read more

From midway through 2012, when jihadis started to travel to Syria, their presence was apparent at all points of the journey to the border: at Istanbul airport, in the southern cities of Hatay and Gaziantep – both of which were staging points – and in the border villages. Foreigners on their way to fight remained fixtures on these routes until late in 2014 when, after continued pressure from the EU states and the US, coordinated efforts were made to turn them back.

By then, Isis had become a dominant presence in parts of north and east Syria. It had splintered non-ideological factions of the Syrian opposition as well as Islamist groups, both of which had been backed by Turkey, and ensured that whatever form of governance that emerged from Syria’s ruins would have little to do with the revolution’s original goals.

The steady stream of foreigners who passed through Hatay and Gaziantep made little effort to remain discreet, gathering regularly in local hotels, coffee shops and bus stations. European diplomats alarmed by the gathering threat concluded that the Turkish leadership was sympathetic to conservative Islamists travelling to fight Assad, who had, until his brutal response to pro-democracy demonstrations in 2011, been a friend of the Turkish president, Recep Tayyip Erdoğan. “After that he became an enemy,” said one western official. “Erdoğan had tried to mentor Assad. But after the crackdown [on demonstrations] he felt insulted by him. And we are where we are today.”

As Syria unravelled, Turkey doubled down on its commitment to a range of militant groups, while at the same time appearing to recognise that the jihadis who had passed through their territory were hardly a benign threat. The change in the dialogue with western officials was marked: security officials no longer insisted on the extremists being called “those who abuse religion”. Labelling them “terrorists” in official correspondence was no longer the problem it had been.

Russia's emotive talk won't lead to military action, say analysts Read more

Despite that, links to some aspects of Isis continued to develop. Turkish businessmen struck lucrative deals with Isis oil smugglers, adding at least $10m (£6.6m) per week to the terror group’s coffers, and replacing the Syrian regime as its main client. Over the past two years several senior Isis members have told the Guardian that Turkey preferred to stay out of their way and rarely tackled them directly.

Concerns continued to grow in intelligence circles that the links eclipsed the mantra that “my enemy’s enemy is my friend” and could no longer be explained away as an alliance of convenience. Those fears grew in May this year after a US special forces raid in eastern Syria, which killed the Isis official responsible for the oil trade, Abu Sayyaf.

A trawl through Sayyaf’s compound uncovered hard drives that detailed connections between senior Isis figures and some Turkish officials. Missives were sent to Washington and London warning that the discovery had “urgent policy implications”.

Few will believe Russia’s ‘proof’ that its jet was in Syrian airspace | Keir Giles Read more

Shortly after that, Turkey opened a new front against the Kurdish separatist group, the PKK, with which it had fought an internecine war for close to 40 years. In doing so, it allowed the US to begin using its Incirlik air base for operations against Isis, pledging that it too would join the fray. Ever since, Turkey’s jets have aimed their missiles almost exclusively at PKK targets inside its borders and in Syria, where the YPG, a military ally of the PKK, has been the only effective fighting force against Isis – while acting under the cover of US fighter jets.

Senior Turkish officials have openly stated that the Kurds – the main US ally in Syria – pose more of a threat than Isis to Turkey’s national interests. Yet, through it all, Turkey, a Nato member, continues to be regarded as an ally by Europe. The US and Britain have become far less enamoured, but are unwilling to do much about it. The worry in both capitals is that to do so would introduce yet another variable into an already highly volatile region, where alliances, strategies, and implications are constantly changing.

“Turkey thought they could control it all,” said one senior western official. “But it got out of their hands. It has come back to bite them in the heart of Ankara [a double suicide bombing in October that was claimed by Isis] and it will haunt them for a long time.”