IN ANOTHER era, tanks might now be on the streets of Ankara and Istanbul. Over the past year Turkey has seen a crackdown on protests, corruption scandals, a purge of the police and judiciary, paranoid talk of foreign plots and fifth columns, an economic slowdown and more attempts to Islamicise society. Given this turmoil, Turkey’s soldiers would no doubt be tempted to sweep aside the failed politicians (as they have done four times in the past). That the generals have remained in barracks—or, in many cases, in jail—is a sign of democratic progress. But after years of strong growth and political reform, Turkey is sliding backwards, with more than a whiff of authoritarianism about the prime minister, Recep Tayyip Erdogan, whose Islamist-flavoured AK party has been in power since November 2002.

Mr Erdogan claims that a wave of arrests on December 17th, as part of an anti-corruption investigation that included the sons of three cabinet ministers, was a more grievous assault on democracy than any past coup. Indeed, he is making overtures to the same generals whom he put behind bars. His enemy now is his former ally, Fethullah Gulen, Turkey’s most influential cleric, who lives in self-imposed exile in Pennsylvania and whose devotees are thought to have infiltrated the police and judiciary. Hence Mr Erdogan’s reallocation of hundreds of policemen and prosecutors, and his legal grab for greater control over the judiciary.

But in seeking to extirpate the enemy within, Mr Erdogan risks wrecking Turkey’s chances of joining the European Union. His visit to Brussels on January 21st, his first in three years, was meant to accelerate EU membership talks that began in October 2005, then stalled but had been briefly revived in recent months. Instead, it will be an achievement just to avoid a public bust-up with the short-fused prime minister. In coded warnings, senior officials say Turkey faces a make-or-break test: if Mr Erdogan’s legal changes seriously undermine judicial independence, the EU may suspend the talks. The so-called Copenhagen criteria require candidates to have “stable institutions guaranteeing democracy, the rule of law, human rights and respect for and protection of minorities”. Eurocrats stress that suspension remains a “nuclear option”. Perhaps Mr Erdogan will withdraw or modify his new law; perhaps President Abdullah Gul will reject it. The enlargement commissioner, Stefan Füle, says Turkey should consult the EU before changing the judiciary’s legal status.

Turkey’s European ambitions go back as far as 1959. Its membership talks have been slow, partly because of the dispute over Turkey’s 1974 occupation of northern Cyprus. The EU blocked eight of the 35 negotiating “chapters” because of Turkey’s refusal to open its ports and airports to (southern) Cyprus; Cyprus itself blocked another six; and France under President Nicolas Sarkozy blocked a further four. Military relations between the EU and NATO are also stuck (Turkey is a member, but Cyprus is not).

Until recently Mr Erdogan would boast that Europe needed Turkey, with its dynamic economy and geostrategic role, more than Turkey needed Europe. He pursued a policy of “zero problems” with his neighbours in the Middle East. When the Arab spring erupted in 2010 Turkey was held up as a model of moderate, democratic Islam. But the shine came off after his heavy-handed suppression of last June’s mass protests against plans to build over Gezi Park in Istanbul. His neo-Ottoman foreign policy fell apart when the Syrian civil war intensified and the Egyptian army unseated the country’s elected president, Muhammad Morsi, an Islamist ally. Turkey’s relations with America have been strained, not least because of a tentative decision to buy air-defence missiles from China and differences over Israel.

As Mr Erdogan’s problems have multiplied, his disdain for Europe has faded. It helps that France now has a less Turkophobic president in François Hollande. Last May Turkey signed a contract for a nuclear power station with a consortium including France’s Areva; Mr Hollande is due to visit Turkey later this month. So even though Mr Erdogan’s sultan-like tendencies have become clearer, Turkey’s accession efforts lurched forward last autumn. In October the EU opened a new chapter, dealing with regional policy. In December Turkey agreed to start taking back illegal migrants crossing into the EU, against a commitment to negotiate a visa-liberalisation deal for visiting Turks. For Ian Lesser of the German Marshall Fund, a transatlantic think-tank, Turkey now needs a “zero problems” strategy with the West. But the latest upheaval makes that harder. Turkey’s friends struggle to defend Mr Erdogan. And the Tory-led government in Britain, once Turkey’s biggest champion, has become sceptical of EU enlargement and the free movement of workers.

Too big to swallow

The accession of Turkey touches one of the club’s great unanswered questions: where are the borders of Europe? It is easy to say that the small countries of the western Balkans should one day join. But Turkey, like Ukraine, may be too big to let in.

To Brussels insiders, the lack of a clear membership path has weakened the EU’s ability to influence Turkey. But it is a stretch to claim, as some do, that Europe has “lost” Turkey as a result. Europe cannot settle a dogfight between a shadowy brotherhood that has infiltrated organs of state and an increasingly intolerant prime minister who thinks he embodies the state.

Perhaps the EU could help by opening chapter 23, on the judiciary and fundamental rights, and chapter 24, on justice, freedom and security. This would not be to reward Mr Erdogan, but to increase the pressure on him. Yet that would require the obdurate Greek-Cypriots to come to their senses. If even they cannot see that their own best interest lies in a more democratic and European Turkey, why should Mr Erdogan be any different?

Economist.com/blogs/charlemagne