Supporters of Turkish President Tayyip Erdoğan gesture as they attend his rally in Istanbul, Turkey, on June 22.Alkis Konstantinidis / Reuters

ISTANBUL—Few members of Turkey’s battered political opposition were surprised when President Recep Tayyip Erdoğan won the constitutional referendum of April 2017, which transformed the country from a European-style parliamentary government into a presidential system. What did surprise them: that after campaigning relentlessly, partnering with nationalists who were once his enemies, stirring up tensions with Germany and the Netherlands to bring out the diaspora vote, and allowing his supporters to intimidate those campaigning against expanding his powers, Erdoğan’s margin of victory was just under 3 percent. Allegations of vote irregularities, meanwhile, could have affected up to 2.5 million ballots. Galvanized by the results, Erdoğan’s opponents took to the streets to demand a recount. They later marched across the country to bring together the disparate opponents of Erdoğan and his Justice and Development Party (AKP).

Erdoğan first rose to power in the early 2000s as a reformer and a democrat promising to curb the power of the military. In recent years, he has taken an authoritarian turn, according to critics and independent human-rights monitors. His government has been accused of jailing journalists and dissidents, bending the judiciary to its will, and purging and jailing tens of thousands of Turks following the failed 2016 coup.

Ahead of the first round of elections on June 24, which could further entrench Erdoğan and the AKP, his liberal, nationalist, leftist, and Islamist opponents are trying to prevent potential cheating at polling stations. They’re training, equipping, and deploying election monitors, and have even developed a smartphone app to let their supporters monitor the votes. They seek to prevent Erdoğan from using the power of the state to seize victory, but also to restore confidence among their supporters that their votes will count.

Defeating Erdoğan won’t be easy. The elections will be held under a state of emergency that restricts public gatherings and civil liberties. Authorities have also imposed limits on public gathering and press activity in five provinces, according to a report by the Organization for Security and Co-operation in Europe (OSCE). In addition, the AKP and its nationalist allies pushed through a number of changes to the electoral law, including one that will allow voting stations to accept ballots that do not bear the election commission’s official stamp. The changes to the law also expanded the election commission’s authority over the makeup of ballot-station committees, and allowed for the relocation of ballot boxes in insecure parts of the country—a move that will affect some 144,000 voters in 16 provinces.

“These changes … along with the fact that the elections will be held in the shadow of the nationwide state of emergency raised questions over election security, and put it on the main agenda of the people,” Onursal Adıgüzel, one of the rising stars of the secular, liberal Republican People’s Party (CHP), told me. Adıgüzel also said that since the referendum, the opposition has been preparing for fraud. “We call on our citizens to vote without being overwhelmed by fear. We promise our citizens that we will not let a single vote to be stolen,” he wrote to me in an email. Meral Akşener, the leader of the newly formed İyi, or “Good” Party, is running as a presidential candidate while her party runs for parliament in partnership with the CHP. She declared that she would “sit in front of the Supreme Election Council headquarters” on election eve to protect the ballot boxes.

The AKP appears cognizant of these concerns, and has said that the election will be free and fair and closely monitored for fraud. But on the campaign trail, Erdoğan has done little to assuage the opposition’s fears. In a speech posted and then later removed from Facebook by one of his supporters, he allegedly called on ward captains in Istanbul to get to the polling stations early on election day. “If we get the majority in the counting committees, this thing will be over in Istanbul before it even starts,” he said.

Opposition supporters have also accused broadcasters, both public and private, of backing Erdoğan. An analysis of state media conducted by the opposition during the last two weeks of May showed that Erdoğan and his coalition received nearly 68 hours of coverage, compared to less than seven hours for the CHP and about 23 minutes for other opposition parties. “The media landscape is dominated by outlets whose owners are considered affiliated with the government or depend on public contracts,” the recent OSCE report said. Erdoğan’s supporters have countered, arguing that the president of the republic merits continuous coverage.

Turkey’s beleaguered Kurdish minority will play a key role in the elections. Polls suggest that Erdoğan will either win a narrow majority or fall just short of the votes needed to secure the office of the presidency, and that his party coalition will claim a majority of seats only if the leftist, Kurdish-led opposition Peoples’ Democratic Party (HDP) fails to surpass the 10 percent hurdle for obtaining a block in parliament. While most Kurds vote HDP, a sizable minority support AKP. Many fear the sparsely observed and highly securitized Kurdish areas of the southeast will be ground zero for any potential cheating.

In recent days, Erdoğan has launched a fresh offensive on Kurdish guerrillas hiding in northern Iraq, a move opposition politicians alleged showed the lengths Erdoğan would go to secure victory. “If Erdoğan, who has not conducted an operation for 16 years, is conducting an operation [against the Kurds] while 20 days are left to the elections,” Ümit Özdağ, the İyi Party deputy chairman, said in a recent interview, “this is not a military operation but an operation with the aim of political propaganda.”

Even without any election-day shenanigans, Erdoğan is in control. He moved the vote up from November 2019 to the summer, when many of his well-heeled secular opponents take their holidays. One of his strongest opponents, Selahattin Demirtaş, head of the HDP, is currently in pretrial detention on accusations of supporting terrorism. He communicates with voters through social media, but was allowed to address the nation on state television for 10 minutes on Sunday.

And yet, Erdoğan’s opponents are optimistic. Opposition parties have pitched colorful tent cities in Istanbul and other cities, gathered for protests, rain or shine, and driven through the streets in vans, blaring out campaign jingles and handing leaflets to pedestrians on busy commercial streets. Both the CHP candidate, Muharrem Ince, and Aksener seem to be having fun. Tens and perhaps hundreds of thousands attended a massive rally for Ince in the coastal city of Izmir on Thursday.

Erdoğan, meanwhile, seems tired and off-key. In recent days, he has said voters should vote for him because every Turkish family now owns a refrigerator, which, as his opponents pointed out, has been true for decades. He also vowed to open a network of free coffee houses, an odd promise for a country filled with affordable teahouses, cafes, and eateries. “I am saying that I will open factories, he is saying ‘let us open coffee houses,’” Ince told a rally in early June. “I am promising employment for the youth. He will deliver free cakes.”

Opponents hope to challenge the AKP’s attempts at cheating by positioning at least two trained volunteers at each of Turkey’s ballot boxes. To make their job easier, they also created “Fair Election,” an app that allows each observer to upload details for each ballot box, including the number of votes cast and the names of observers, to a central location overseen by opposition leaders. Based on an analysis of previous elections, they have composed a list of fraud-prone regions. Both the OSCE and the Parliamentary Assembly of the Council of Europe have also dispatched election observers to Turkey.

But many worry that if Erdoğan thinks he’s likely to face defeat, he will cheat anyway. “I see fraud,” a political counselor at one Western embassy told me. “They’re going to create any sort of obstacle for opponents. But I think he would do paper fraud in the end. I don’t think he’ll give up power.”

Indeed, even if Erdoğan’s opponents uncover irregularities, it’s uncertain whether election commissioners beholden to the president would rule against him. According to the opposition, Turkey’s high election commission has repeatedly failed to take their concerns and allegations seriously. “Erdoğan is cheating already. He cheated before. And he will probably cheat again,” said Selim Sazak, a Washington-based opposition supporter and a researcher at Brown University. “We document irregularities, we post videos, and then what? We go file a petition to the election commission, where it dies on arrival. I’m not saying that it’s pointless. If we don’t do this much, we stand no chance. None whatsoever. Erdoğan would win with 200 percent. The opposition has a gashing wound. The anti-cheating organization is a Band-Aid.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.