MOST Turks are understandably grateful to the ruling Justice and Development (AK) party, and especially to their prime minister, Recep Tayyip Erdogan (pictured). Since AK first came into single-party government in November 2002, the economy has done exceptionally well. Turkey has reformed itself enough to secure the opening of membership negotiations with the European Union. It has pursued a more vigorous foreign policy in its neighbourhood. And a politically intrusive army has been firmly returned to its barracks.

Thanks to these achievements, Turkey has become an economic and political power, both in its region and in the world. Although its relations with Israel and America have soured, in the Islamic world it stands out as a thriving Muslim democracy—an inspiration to the Arab awakening. This is in striking contrast to the mess that the AK party inherited: an economic meltdown, a bust banking system, weak coalition governments that came and went with dizzying rapidity, and the ever-present threat of military intervention.

That Turkish voters are poised to return Mr Erdogan to power in the general election on June 12th is thus not surprising. It is, however, worrying. Mr Erdogan is riding sufficiently high in the polls to get quite close to the two-thirds parliamentary majority that he craves because it would allow him unilaterally to rewrite the constitution (see article). That would be bad for Turkey.

This judgment is not based on the canard that a theocracy is being built. Nine years ago Istanbul's secular establishment fretted about AK's Islamist roots—and some early squabbles over religious schools and allowing women to wear the Muslim headscarf at university were indeed troubling. But since then the pious Mr Erdogan and his party have been pragmatic. No matter what the army and too many Israelis (and Americans) whisper, there is scant evidence that AK is trying to turn a broadly tolerant Turkey into the next intolerant Iran.

Explore our interactive guide to Turkey's upcoming general election

The real worry about the AK party's untrammelled rule concerns democracy, not religion. Ever since Mr Erdogan won his battles with the army and the judiciary, he has faced few checks or balances. That has freed him to indulge his natural intolerance of criticism and fed his autocratic instincts. Corruption seems to be on the rise. Press freedom is under attack: more journalists are in jail in Turkey than in China. And a worrying number of Mr Erdogan's critics and enemies, including a hatful of former army officers, are under investigation, in some cases on overblown conspiracy charges.

On top of this, on the campaign trail Mr Erdogan has begun to take a more stridently nationalist tone: he and his party are no longer making serious overtures to the Kurds, Turkey's biggest and most disgruntled minority. Mr Erdogan has hinted that if he wins a two-thirds majority next week, he will change the constitution to create a powerful French-style presidency, presumably to be occupied by himself. In a country that is already excessively centralised, that would be a mistake.

It would be better if a new AK government were to take a more broadly inclusive approach. Turkey's constitution does indeed need a makeover, but it should be rewritten in consultation with other political parties and interest groups, and not as an AK project. The best way to make sure this happens would be to push up the vote for the main opposition party, the centre-left Republican People's Party (CHP). Assuming that two smaller parties also get into the grand national assembly, that should be enough to deny AK its two-thirds majority.

As it happens, the newish CHP leader, Kemal Kilicdaroglu (nicknamed Gandhi for his ascetic ways), has been a huge improvement on his dinosaur of a predecessor, Deniz Baykal. He has weeded out much of the party's old guard, shown himself intolerant of corruption and shifted the party away from its instinctive sympathy for the army's role in politics. Even more remarkably, Mr Kilicdaroglu has been attracting more supporters than Mr Erdogan to election rallies in the mainly Kurdish south-east, where the CHP has long been weak, by talking more openly of giving all of Turkey's 81 provinces greater autonomy (it probably helps that he is from the Alevi Muslim minority and that he may have Kurdish forebears).

A vote against autocracy

The AK party is all but certain to form the next government. But we would recommend that Turks vote for the CHP. A stronger showing by Mr Kilicdaroglu's party would both reduce the risks of unilateral changes that would make the constitution worse and give the opposition a fair chance of winning a future election. That would be by far the best guarantee of Turkey's democracy.