DO NOT underestimate the importance of Turkey to the West. In the cold war it was a NATO bulwark against the Soviet Union. Then it was a model of a thriving Muslim democracy on the edge of an oppressive and violently chaotic Arab world. More recently Turkey has admirably taken in 2m refugees fleeing fighting across the border in Syria.

But these days Turkey’s reputation is tarnished. An election on November 1st takes place at a time of renewed war against Kurdish PKK guerrillas, suicide-bombings at home, assaults on a free media, the sidelining of independent prosecutors and judges, and a sense that Turkey has sometimes been worryingly indulgent towards the jihadists of Islamic State (IS).

The blame for much of this lies with the country’s imperious president, Recep Tayyip Erdogan. The election he has engineered, the second in five months, is an attempt to entrench himself in power. Turks should rebuke him by voting for his opponents, and put him back in the ceremonial box he supposedly stepped into when he became president a year ago.

The signs are that many Turks are indeed tiring of the antics of their formidable but increasingly autocratic and intolerant president. In June the Justice and Development (AK) party that he co-founded 14 years ago lost its majority in a general election. The proper course would then have been for the party’s leader, Ahmet Davutoglu, to form a coalition government, or to let other parties have a shot. Yet even though, as president, Mr Erdogan is meant to stand above the fray, he intervened to scupper all efforts at coalition-building. His plan was to force a second election that he hoped would not just restore AK’s majority but might even win it the three-fifths of seats it needs if it is to propose constitutional change—and thereby create a presidential system in which he would have extra powers.

Worse still, to maximise AK’s chances, Mr Erdogan has torpedoed the peace process with the country’s Kurds in the hope that this will push down the vote for the pro-Kurdish People’s Democratic Party (HDP). This is especially sad since, as prime minister, Mr Erdogan was a brave proponent of a peace settlement with the Kurds. Now the army is once again at war with Kurdish PKK fighters. Turkish warplanes have struck Kurdish strongholds in Syria and Iraq, even though Kurds have proved to be among the most effective opponents of both Syria’s president, Bashar al-Assad, and IS. Inside Turkey a string of shootings and bombings, including a horrific double suicide-bombing in Ankara on October 10th, widely attributed to IS, which killed 102 people, have made it almost impossible for the HDP to hold election rallies around the country. Its members have also been kept off the airwaves, as media intimidation has been used to hobble opposition parties (see article).

Fortunately, most Turkish voters seem not to have been swayed by Mr Erdogan’s cynical manoeuvring. Most opinion polls suggest that the HDP will once again get over the 10% threshold of the vote needed to win seats in the grand national assembly. That means there is likely to be another hung parliament. This time the president must not sabotage the task of forming a coalition government.

Eroding Erdogan's power: Our guide to Turkey's general elections A steady and reliable government is especially vital just now because Turkey faces big challenges at home and abroad. The economy has slowed, inflation and unemployment have risen and the lira has tumbled. The country needs determined liberalisation to increase labour- and product-market flexibility and improve competitiveness. The breakdown of the Kurdish peace process and the rise in violence has cast a pall not just over the south-east of Turkey but also over the whole country’s tourist industry. Then there are the troubles in the region, most notably Syria. Mr Erdogan went out on a limb four years ago in demanding that Mr Assad had to go. He has belatedly allowed the Americans to use their Incirlik air base to bomb IS targets, yet his own air force has directed its attacks mostly against the Kurds. Turkey has taken in more Syrian refugees than other countries, but it has also become the main migrant route to Europe. A new government will have to reassess its approach to Syria and to the handling of refugees—and it should do this in co-operation with its European and NATO allies, not against them.

The advice of friends

Turkey’s allies should not tone down their criticisms of Mr Erdogan. Some European Union leaders have shown worrying signs of doing this to persuade him to be more helpful in stemming the flow of refugees and other migrants to Europe. This year’s European Commission annual assessment of Turkey, which was expected to be highly critical of the government’s undemocratic habits, has been quietly postponed. After the election, any new government is likely to try both to reinvigorate Turkey’s stalled EU accession talks and to win visa-free access to Europe for its citizens. The EU should make clear that progress on these will depend on moves to restore fuller democratic freedoms in Turkey.

Mr Erdogan and his AK government did much to reform Turkey and to improve its economy in the 2000s. But after over a decade in power, he is no longer good for his country.