If Recep Tayyip Erdoğan, Turkey’s belligerent president, were a true patriot with his country’s security and wellbeing at heart, he would resign immediately. He has made an appalling hash of things. His Syrian misadventure, while unusually calamitous, is but the latest in a long line of foreign blunders. Erdoğan abuses his position. He harms his country. He is still in office not because he is popular but because of the fear he instils and the power he crudely wields. It’s time for him to go.

Getting rid of Erdoğan is a matter for the Turks. And it wouldn’t be quite as difficult as it might sound

Having said that, doing the decent thing is not Erdoğan’s strong suit. His 16 years in power – as prime minister and then president – have been marked, at home, by growing authoritarianism and repression. The economy is an indebted mess. Corruption and nepotism thrive. After a 2016 military-led coup failed, Erdoğan exploited it to purge political opponents, the judiciary, civil society and the media. Tens of thousands of supposed plotters were jailed.

Erdoğan’s creation of an executive presidency, concentrating power in his hands, was narrowly agreed in a 2017 referendum, and is proving a disaster for Turkish democracy. Effective checks and balances circumscribing his actions are lacking. Absent, too, are experienced figures, such as former prime minister Ahmet Davutoğlu and ex-deputy prime minister Ali Babacan, who might have reined him in. Alienated by his domineering behaviour, they have wisely jumped ship.

Turkey’s ill-considered Syrian invasion is a byproduct of Erdoğan’s dictatorial behaviour. Like Donald Trump, he trusted his gut, not seasoned advisers. Now Syrians, mostly Kurds, are paying the price. All western leaders share some blame here. They have long known Erdoğan for what he is – yet for reasons of realpolitik, they looked the other way.

These leaders must now be wishing Erdoğan gone. He has made Trump look like a gullible idiot – though, admittedly, that’s not hard. But his Syrian warmaking has also deeply alarmed regional states, uniting the Arabs, Israel and Iran in angry opposition while scaring the socks off the Saudi princes. They look askance at the Erdoğan-Trump betrayal of the Kurds and rightly worry whether US security guarantees, and Nato solidarity, are mere desert mirages.

Nor does the EU, scarred over the years by Erdoğan’s tantrums over Turkey’s accession, have any love for him. Perhaps Brussels believes his threat to send 3.6 million Syrian refugees to Europe. What’s certain is that it justifiably fears his Syrian invasion will boost Islamic State terrorism. His early departure would be a boon for Europe.

Play Video 4:04 What does Turkey's military action in northern Syria mean? – video explainer

But getting rid of Erdoğan is a matter for the Turks. And it wouldn’t be quite as difficult as it might sound. True, Erdoğan has overseen an extraordinary attack on political and civil rights, including the right to free speech and a free press. His purges have swept up senior opposition politicians, notably Selahattin Demirtaş, leader of the pro-Kurdish People’s Democratic party (HDP), who came third in last year’s presidential election despite being in jail. Judges, police chiefs, lawyers and civil servants who show signs of independent thinking have been sanctioned. The current crisis has brought further crackdowns on social media. And all the while, Erdoğan pursues an often lethal vendetta against Turkey’s Kurdish minority, linking them, for self-serving purposes, to the outlawed Kurdistan Workers’ party (PKK).

Yet change is under way. Politically, Turkey is a divided country, split primarily between urban and rural – and since its founding in 2001, Erdoğan’s neo-Islamist Justice and Development party (AKP) has appealed to the latter constituency, to those attached to the traditional, devout way of doing things. Now, however, the mass movement of people into the cities is accelerating, the demographics are shifting, and so too are political allegiances. Istanbul, for example, has become a mega-city, home to more than 15 million people.

In June, this national evolution translated into a landmark AKP defeat in Istanbul’s re-run mayoral election – a city Erdoğan himself once ruled. Turkey’s opposition, principally the Republican People’s party (CHP), now controls nine out of the 10 biggest urban areas, which account for about 70% of GDP.

As Erdoğan’s excesses and failures mount, loyalty to him is weakening. High-profile AKP defectors include not only Babacan and Davutoğlu, who plan new political parties, but also Abdullah Gül, Turkey’s former president and a man regarded for many years as Erdoğan’s chief crony. A new Nation Alliance of the CHP and the Good (İyi) party was launched earlier this year. And there is talk of a broader, anti-AKP front encompassing the pro-Kurdish HDP – although analysts suggest it’s a long shot.

The Kurds have faced their own ‘endless war’. And this is a dark new chapter | Giran Ozcan Read more

Erdoğan’s grip on power remains firm, but not as firm as it once was. The furious international backlash to his Syrian disaster, publicly exposing his fallibility, will weaken it further. If new steel and other sanctions imposed by Trump intensify entrenched economic problems, causing more hardship, price rises and job losses, and if Turkish army troops begin dying in large numbers in a Syrian quagmire, this modern-day sultan could be in terminal trouble.

Turkey, when all is said and done, is a democracy, not a one-man dictatorship – a fact Erdoğan has never fully grasped. Now, the charismatic aura that once surrounded him is dissolving. The spell that enthralled the country for so long is definitively broken. Erdoğan’s political obituaries are already being penned. He should jump before he is pushed.

• Simon Tisdall is a foreign affairs commentator