In the summer of 2019, Turkey, my home country that had been going downhill for years under the populist and authoritarian rule of President Tayyip Erdogan, made some rare good news: The municipal elections of Istanbul and Ankara, the two largest cities, were won by opposition candidates. Also, the winner of Istanbul, Ekrem Imamoglu, had emerged as a new political star, who could perhaps beat Erdogan in a future presidential election. So, Turkish democracy was still alive, and there was still hope.

But let’s fast forward from 2019 to this week, when Turkey was shaken by shocking news. An Istanbul court sentenced Ekrem Imamoglu for more than two years in jail for “insulting state officials.” The officials in question were Turkey’s Erdogan‐​orchestrated judiciary, which Imamoglu had called “fools” for trying to cancel his very electoral victory in 2019, by recasting the ballots. (Maybe “apparatchiks” would be a more fitting term, but of course Imamoglu had the right to say whatever he thinks about an unabashedly partisan judiciary.)

Needless to say, this verdict is a travesty of justice, and it is purely political: Just months before the presidential elections scheduled for June—the exact date is not yet clear—the regime is attacking the most popular candidate against Erdogan. The legal process will still linger for a few months, but it is possible that Imamoglu’s verdict can be confirmed before the ballots, which will also legally ban him from politics for the next two years.

Why is Erdogan doing this now? Turkey’s pundits are heatedly debating the question. My guess is that Erdogan, by taking down the most threatening rival, wants to compete with the less charismatic leader of the main opposition party, Kemal Kilicdaroglu, whom he thinks he can beat. Erdogan may also be planning to grab the Istanbul municipality by sending Imamoglu to jail, and replacing him with one of his loyalists—as he did in many Kurdish provinces before.

The very fact that such calculations are necessary for Erdogan reminds that elections are still genuine and decisive in Turkey—unlike in a typical dictatorship, where the ruler always wins with some 99 percent of the vote. However, it is also painfully clear that Erdogan can tailor the whole political landscape by using the judiciary as his rod, and enlisting almost all major media as his propaganda machine. It is hard to call such elections “free and fair.”

Which proves all the concerns about “illiberal democracy” quite right. The latter is a simply electoral democracy that is devoid of political liberalism—with pillars such as freedom of speech, rule of law, and judicial independence. Without such guardrails, democracy can simply devolve into the tyranny of the majority, embodied in the whimsical rule of a strongman—which is exactly what Turkey is today.

How far Turkey will go down this road is still a curious question. No one also knows what will happen in the forthcoming presidential elections. But the Imamoglu affair suggests that Erdogan will do everything he can in order to win—and the tools in his arsenal are alarmingly abundant.