The recent failed coup attempt in Turkey has not only thrown the country into chaos, but could derail the very fundamentals of the country’s foreign policy relations with the US and Europe. In its aftermath, there could be grave consequences for European-US co-operation with Ankara to combat the Islamic State in Syria; more generally, Turkish-European Union ties, including the efforts to work together to stem the flow of Syrian refugees, are now threatened.

The mood in the country is nervous, angry and dark. Although the coup plot was extinguished within a day last Saturday, an eerie feeling still lingers over Ankara, the capital, which saw the most violence. Fearing for his safety, Erdoğan did not return to Ankara until last Wednesday. The bombing of the city, including the targeting of parliament, has deeply shocked the residents of the city, which has not experienced a military attack in more than 600 years.

Consider, too, the effect on Istanbul, also targeted. F-16 planes, operated by coup plotters who intended to terrorise residents, flew at low altitude and high speed over the city, creating supersonic booms that produced the illusion the city was being bombed.

The plot was traumatising in other respects. As a factional uprising, it went against everything we know about the hierarchical Turkish military and the history of bloodless coups. That the military does not fire at its own people is an article of faith. This time, the putschist faction did. More than 100 citizens, as well as putschists, were killed in the violence.

Many in the pro-government camp believe that Gulen’s status as US resident implicates Washington in the coup

The bulk of the Turkish military, including the force commanders and the chief of staff, who were held at gunpoint by the putschists, refused to participate in the plot. But following the failed coup, the Turkish military is so fragile that without a helping hand from its Nato allies that the secular institution could implode.

In fact, the abiding trauma is so deep that the divisive president, Recep Tayyip Erdoğan, finally has a unified audience. Erdoğan has focused on two key retributive measures: asking the US to extradite Fethullah Gülen, a Turkish Muslim cleric living in the country, whom he blames for orchestrating the violence; and bringing back capital punishment.

Speaking last week, Erdoğan vowed to approve the reinstatement of capital punishment if Turkish parliament, controlled by his Justice and Development party (AKP), voted to pass such a measure. The policies would hurt Turkey’s ties with Washington and Brussels.

Another blow to US ties is that many in the pro-government camp believe that Gulen’s status as US resident implicates Washington in the coup. Prominent columnists in pro-AKP newspapers have already aired these allegations and at least one other cabinet member, Labour minister Süleyman Soylu, publicly blamed the US for being behind the coup.

What's happened in Turkey? How the failed coup unfolded Read more

This is problematic, because it is not how Washington sees things. US National Intelligence director, James Clapper, told Washington Post columnist David Ignatius that “Turkish allegations that cleric Gulen planned the attempted coup” did not pass the “‘smell test’ of credibility”.

Another problem is Erdoğan’s shallow understanding of how democratic governments work. He views other countries through the lens of his own autocratic ways. For instance, in April 2009, Turkey objected to Danish prime minister Anders Fogh Rasmussen’s appointment as Nato’s secretary general. In the aftermath of the Danish cartoon crisis, Ankara’s reasoning was that “Rasmussen had allowed Prophet Muhammad’s cartoons to be published” in Danish media.

If US courts reject his request for Gulen’s extradition, Erdoğan will certainly blame the White House. Subsequently, the Turkish leader will have two options. First, he may link the extradition issue to anti-Isis co-operation. If Turkey were to present the US with an ultimatum, this would backfire, and the US would move its anti-Isis operations from Turkey to Mediterranean aircraft carriers and Persian Gulf bases. Alternatively, Erdoğan could retaliate by simply pulling the plug on anti-Isis co-operation with Washington. In both cases, US-Turkish ties will rupture.

With regard to the EU, Erdoğan will be even bolder. Should Turkey bring back capital punishment, Brussels is almost certain to suspend both accession talks and the visa deal with Turkey – Ankara’s promise to control the flow of refugees into the Union in return for Europe’s promise to allow visa-free travel for Turkish citizens inside the EU’s Schengen area. If Brussels took those steps, Erdogan threatens to walk away from the EU.

Overall, the coup attempt will further complicate Turkey’s relations with Europe and the US. This explains why, for the first time in recent memory, there is serious discussion of Turkey’s Nato membership in Ankara, with some questioning whether it should move instead to becoming a “friend” of Russia. Erdoğan, who already has some Eurasianist foreign policy instincts, could easily accomplish this pivot, especially since the Turkish military, the strongest link between Nato and Ankara, is disfigured.

Before the failed coup, Ankara and Moscow had already taken steps to patch up their relationship, which had suffered a setback last November when Turkey shot down a Russian plane that violated Turkish airspace from Syria. Following a 27 June letter Erdoğan sent to Putin, expressing regrets, the two leaders had agreed to meet during the first week of August to discuss “normalisation”.

The Kremlin has already taken note of the developments: on 29 June, Russian airline Aeroflot lifted its ban on flights to Turkey, a signal from Moscow of its willingness to lift sanctions precipitated by the plane incident. Putin is likely to show up at his meeting with Erdoğan with a goody basket, such as promises of boosting tourism, trade, construction and pipeline deals.

In short, Turkish foreign policy now stands at a crossroads. If Washington does not convince Turkey of its commitment to a thorough review of Ankara’s request for Gulen’s extradition, Ankara may turn to Russia. And should Ankara bring back capital punishment, which looks highly likely, the EU-Turkey ties and refugee deal are likely to fail.

Soner Cagaptay is a senior fellow at the Washington Institute for Near East Policy