White House/Flickr

When Turkey’s Justice and Development Party lost the Istanbul mayoral race in March, it was a triumph for democracy. The party, which dominates almost every level of the Turkish government, has spent the last decade locking up critics and packing the courts. After it lost control of Istanbul, voters learned that their political rulers are not politically unstoppable. “It is a great development for Turkish democracy, law, and for the reliability of the electoral system in the country,” said Erdogan Toprak, a leading opposition politician.

But for Turkish President Recep Tayyip Erdogan, it was a humiliating defeat. Erdogan founded the Justice and Development Party in 2001 after serving as the city’s mayor from 1994 to 1998. As returns from Istanbul came in, he reportedly threw a temper tantrum. He then refused to concede. Instead, Erdogan demanded—and eventually received—a recount. When it showed that the Justice and Development Party had, in fact, narrowly lost, the president asked the country’s High Election Council to invalidate the result and rerun the contest. He claimed the outcome was the result of fraud.

Erdogan, in other words, behaved like Donald Trump. When defeated, he raged and cried foul. And then he demanded that the nation’s ostensibly independent institutions protect his ego from injury.

That is one reason why Americans should be concerned that Turkey’s Election Council granted Erdogan’s wish. Citing “situations which affected the result and honesty” of the polls, the body nullified the opposition candidate’s victory certificate and scheduled a new election for June 23.

While Trump’s presidency has put American democracy in a state of emergency, our situation is a long way from Turkey’s. Our democratic institutions are far stronger, far older, and far more resilient. Our press remains free. We do not have a central electoral authority that can overturn results. When Republicans fared poorly in the 2018 midterms, they accepted defeat.

But if Donald Trump loses in 2020 and refuses to concede, Erdogan’s efforts to negate the will of Istanbul’s voters could be a helpful guide for Trump. The Istanbul election is one of the rare instances in which an existing or aspiring autocrat’s party has clearly lost but won’t give up power. Autocrats almost always rig contests in advance, in part because actually losing threatens the regime’s survival. “Cheating at that stage is really naked,” said Steven Levitsky, a political scientist at Harvard University and the coauthor of How Democracies Die. “It’s a major legitimacy crisis for autocrats.” Given Trump’s poor coordination and America’s institutional resilience, it is likely that any attempt by Trump to steal an election would, like Erdogan in Istanbul, have to happen after the fact.

Unfortunately, despots do sometimes save themselves (or their surrogates) from a clear rout. If Erdogan succeeds here, it will be proof that Trump’s technique for questioning his loss—blaming it on election fraud—works in practice. As Levitsky told me, this is a rare strategy. In most places, the incumbent is so powerful that it’s almost impossible for them to claim they are the victim of fraud. Instead, they are almost always the perpetrator. “Nobody would ever imagine that the President of Bolivia would not have enough control over the state that fraud would not be committed by the state,” Levitsky said.

There are other potential similarities. The Justice and Development Party’s candidate lost the Istanbul mayoral race by 13,000 votes, close enough to sow doubt in the outcome. If Trump were to lose pivotal states in 2020 by small, five-digit numbers—akin to his victory margins in 2016—he could more easily whip up voter fraud hysteria.

And if Trump does narrowly lose, it’s easy to see his legal challenges resembling that of Erdogan’s. In explaining its decision, Turkey’s Electoral Council, which Erdogan himself packed, said that some of the city’s electoral officials were not civil servants and that some result papers had not been properly signed. The Trump campaign could similarly sue counties or states using legal technicalities, with the hope that the cases ultimately wind up before GOP-appointed judges.

“I can imagine the litigation in Pennsylvania taking the form of saying voting booths in Philadelphia were held open an excessively long time, an unlawfully long time, or the vote counters in some Democratic-leaning county unlawfully refused to count late-filed absentee ballots,” Mark Tushnet, a constitutional law professor at Harvard, told me.

Throughout the 2016 campaign, Trump left open the possibility that he might not accept the election results. “I’ll keep you in suspense,” he declared. More recently, his longtime fixer Michael Cohen warned Congress that if the president loses in 2020, he might not concede. If that’s what plays out, and if Erdogan succeeds, Istanbul may be Trump’s template for how to lose an election but ultimately stay in power.