With a Kurdish insurgency brewing at home and US and Russian support for Kurdish forces on Turkey’s southern flank in Syria, an overhaul in foreign policy presented itself as an unavoidable strategic imperative.

This is what the end of 2015 looked like for Turkey: Ankara had no ambassadors in Syria, Israel, Egypt; had to recall its envoys from Moscow and Iraq at various points due to bilateral tensions; could not sail ships in the Black Sea or fly planes on the Syrian border for fear of Russian reprisals; had a tepid relationship with Iran on accounts of the Syrian war; no ties with Armenia; and an increasingly difficult relationship with both the United States and the European Union.

Things had to change.

There were a whole host of factors contributing to Turkey’s isolation in its own region over the past few years – namely the spillover from the Syrian conflict, sectarian tensions in the region, a reflection of Turkey’s own domestic polarisation and a regional backlash to its growing confidence after the Arab Spring. But with a Kurdish insurgency brewing at home and with US and Russian support for Kurdish forces on Turkey’s southern flank in Syria, an overhaul in foreign policy in 2016 and a refreshing of ties with former allies presented itself as an unavoidable strategic imperative.

And so it happened almost out of the blue one day: Turkey announced normalisation with key regional players within almost hours of one another – all squeezed into the last days of June.

Faster than the unraveling of relations with Russia following the downing of its fighter jet last November, Turkey and Russia resumed ties with the blink of an eye this week after Turkish President Recep Tayyip Erdoğan’s letter of apology to the Russian President Vladimir Putin.

Turkey announced normalisation with key regional players within almost hours of one another – all squeezed into the last days of June.

Erdoğan reportedly sent two letters to the Russian leader in June, expressing regret for the November incident, offering to pay compensation to the family of the deceased pilot, and underlining that the suspension in relations resulted in enormous cost to both countries. For Turkey, that cost was economic, as well as strategic, as Turkish officials had been complaining for months. The loss of nearly 4 million Russian tourists had crippled Turkey’s already dwindling tourism industry and Russia’s aggressive presence in Syria curbed its ability to move on its own borders. For the past few months, Turkish officials had been looking for ways to end the animosity. The surprise was not Ankara’s plea but that the green light was given by Putin.

But not just that. In addition to Russia, Ankara also announced last week that months of painstaking negotiations with Israel for the normalisation of relations, disrupted after an Israeli raid on a Turkish aid flotilla to Gaza in 2010, had finally borne fruit. The two countries announced that an agreement was reached for the normalisation of relations on June 27 – only hours before a similar announcement about Russia.

The deal between Turkey and Israel involves Israelis paying hefty compensation ($20 million) to the families of the nine Turkish citizens that were killed in the raid. It also involves Turkey dropping the charges against Israeli officials involved in the raid, and Ankara being allowed to send aid to Gaza via Ashdod port in Israel. After years of acrimony, this is a bitter pill to swallow for both Erdoğan and the Israeli Prime Minister Benjamin Netanyahu, and already there are grumblings from Islamist circles in Turkey about Erdoğan’s compromise on his long-held demand that Israel lift the blockade on Gaza. But the Turkish government is determined to forge ahead and pass the agreement through Parliament before the August summer break. This would allow the two countries to exchange ambassadors after a six-year hiatus.

Turkish officials also hinted this week that economic ties with Egypt – suspended after the breakdown in relations following the coup there in 2013 and by Erdoğan’s harsh stance against Abdel Fatah el-Sisi— could begin soon. In election after election, Ankara’s support for the Egyptian Muslim Brotherhood and its imprisoned leader Muhammed Morsi was an unwavering campaign pledge, with President Erdoğan wrapping up each rally and public gathering with a hand-sign of 4-fingers symbolising his outrage at the massacre of Morsi supporters on Rabia Square following the coup. But at the request of one of its key allies, Saudi Arabia, and as a strategic need to ease its regional isolation, Ankara agreed to a phased normalisation process with the regime in Cairo.

At the request of one of its key allies, Saudi Arabia, and as a strategic need to ease its regional isolation, Ankara agreed to a phased normalisation process with the regime in Cairo.

As if all of this was not a surprise, Mevlüt Çavuşoğlu, Turkey’s foreign minister, was quoted saying that Ankara and Moscow should work together for a political solution in Syria after a meeting with his Russian counterpart, Sergei Lavrov, in the Black Sea town of Sochi last week. This statement suggests that Turkey was also softening its long-held position that peace in Syria requires regime change in Damascus. While it is too early to talk about “normalisation” with the Assad regime, observers had been noting that the Turkish president no longer talks about the evils of Bashar Al-Assad or the Syrian regime in his stump speeches –nor does he lay down conditions for a future arrangement in Syria. Instead of regime change, Ankara seems to be focusing on the more moderate goal of reversing Kurdish gains in northern Syria and sealing off its border from a large chunk of territory controlled by ISIS.

Ironically, Turkey’s attempt to return to a “zero problems with neighbours” policy - the hallmark of ruling Justice and Development Party’s (AKP) regional outlook in its early periods - is taking place after the exit of prime minister Ahmet Davutoğlu – long regarded as the architect of the policy. “All of this had to be done in any case”, a former advisor to Davutoğlu said, although in AKP circles, the former prime minister has now become a convenient scapegoat for Ankara’s foreign policy failures.

“We will increase our friends and decrease our enemies”, Turkey’s new Prime Minister Binali Yildirim announced in his first speech in the Turkish Parliament in late May. This may not seem like a particularly stunning foreign policy insight, but it nonetheless represents something of a departure from recent Turkish practice.

Things have moved fast since. These days the epicentre of Turkey’s foreign policy is no longer the government but the presidency. However, Yildirim’s comfortable relationship with Erdoğan, his pragmatism, and the Turkish president’s continued popularity with his conservative base, all contribute to a smoother reversal of policies that have left Turkey helpless and cornered in a region in turmoil.

Read more on: Wider Europe, Turkey