Turkish President Recep Tayyip Erdoğan has responded to last week’s coup attempt with a hammer. Over the span of just a few days, more than 50,000 people have been fired from their jobs or detained on suspicions that they’re connected to the coup or to the Gülenist movement (which President Erdoğan blames for the coup attempt). Now emergency rule has been imposed, suggesting that more detentions may follow.

Turkish leaders are assuring everyone that the state of emergency is meant to control the situation and to preserve Turkish democracy. But many observers, including in the West, aren’t buying it: There are legitimate fears that these measures will actually further consolidate Erdoğan’s authoritarian rule. And the consequences of Turkey’s continued drift away from democracy isn’t only a human rights or governance problem—it could become a real geopolitical challenge for the West.

The swinging pendulum

Turkey—literally the bridge between Europe and Asia—sometimes seems of two minds on governance issues. On the one hand, its leaders express a commitment to a Western form of governance based on the rule of law, liberal democracy, transparency, and accountability. On the other—and more in the vein of governance styles in Russia, Iran, and China—they sometimes reject what they see as outside interference, restrict civil liberties and government transparency, and promote a heavy state role in the economy.

Although Turkey was welcomed into NATO and other transatlantic institutions after World War II—at a time when Soviet expansionism was a real fear—its commitment to democratic values has always been shaky. The military’s shadow loomed large over Turkish politics (last week’s coup attempt was far from the first) and the country’s human rights record was poor, particularly on minority rights.

Many thought that all this would change when Erdoğan and his Justice and Development Party (AKP) came to power in 2002. They introduced political reforms that propelled Turkey toward EU membership. The Turkish economy excelled: Many people in Turkey once depended on remittances sent by Gastarbeiters (guest workers) in Germany and other West European countries, for instance, but the country quickly became host itself to immigrants from neighboring countries. Tourists, business people, students, athletes, and artists poured into the country in the millions. And Turkey enjoyed considerable soft power in the region and the world, often touted as a model in the wake of the Arab Spring of a country that properly paired mainstream Islamism and democratic governance. None of this would have been possible were it not for Turkey’s growing adherence to Western governance norms and its membership in the transatlantic community.

But the picture has since become rather grim. The events of the past week have renewed concerns about the state of Turkish democracy, yes—but those concerns have in fact been growing for years. Turkey’s commitment to supporting freedom of expression, freedom of the media, anti-corruption efforts, and liberal markets has been in serious doubt for a while. Meanwhile, the economy has stalled, related in part to political developments and to a recent spate of terror attacks that have seriously damaged the overall security situation. It is no wonder that Turkish per capita income—which peaked at $10,800 in 2013—has now fallen to 2009 levels, at $9,950. (That’s an almost 10 percent drop in the span of just two years.) Turkey’s further slide away from Western governance norms would likely only make matters worse, making Erdoğan’s promise of putting Turkey among the largest 10 economies in the world a fantasy.

If you ask Erdoğan and his AKP colleagues why reforms sputtered out, they’re likely to answer with conspiracy theories: They’ll blame the West, the EU, the interest rate lobby, and others. But the AKP has failed to be self-critical, which could have helped it succeed.

Turkey’s choice of orbit

So if Turkey seems to be moving away from Western norms, is it also moving away from the West? Possibly. In November 2013—after years of stop-and-go accession talks with the EU—Erdoğan sought Russian President Vladimir Putin’s support for accepting Turkey into Eurasian organizations like the Shanghai Five. That could be a big geostrategic gain for Russia, something not lost on the Russian press.

Western Europe and the United States would be the biggest losers if Turkey moved closer to Russia’s camp. Losing their partnership with Turkey would deliver a serious blow to the fight against ISIS in Syria and Iraq, for one thing. But it would also further dim prospects that Turkey might really embrace Western-style democracy any time soon. As Ted Piccone has written, Turkey has the potential to be a linchpin of the liberal international order—and a long-term downturn in the country could have wide detrimental effects in regional and global governance.

The path ahead

Finally, is there a role for the United States in all this? In the short term, as Ömer Taşpınar has argued, the United States should offer real help to Ankara in investigating the role of Pennsylvania resident Fethullah Gülen and his movement in last week’s coup attempt. Extradition is a highly sensitive issue, and the United States must defend its legal standards. At the same time, that kind of cooperation could build trust in U.S.-Turkey relations, calm Ankara’s paranoia about a potential U.S. role in the coup attempt (and therefore possibly help minimize the damage to Turkish democracy that Ankara itself might cause in its heavy-handed response), and help the United States build credibility on the rule of law. A thorough investigation—including into the Gülenists—is important for determining who was behind the coup attempt. And it’s in U.S. interests to know: As Turkey is a NATO member, a threat against it should be considered a threat against all members. It is in no NATO member’s interest to allow a political earthquake like this to push Turkey from its fold or towards a rival mode of governance.

This isn’t to downplay the burden now on Ankara; the Turkish government shouldn’t forget that its respect for civil liberties and the rule of law once helped earn it a lot of international respect and a place in the Western community. It’s disappointing that the AKP and Erdoğan supporters have failed to capitalize on their country’s potential. Among its peers in the Muslim world, Turkey had once made the most progress in terms of democratic values and economic growth. Many would still like to believe that that Turkey still exists, in spite of recent setbacks. But for Turkey to win back those gains, its leadership will have to proceed very cautiously and with reason.