Supporters of Turkish President Recep Tayyip Erdogan take part in a rally ahead of the May 14 presidential and parliamentary elections, in Ankara, Turkey on April 30.

Editor’s Note: A version of this story appears in CNN’s Meanwhile in the Middle East newsletter, a three-times-a-week look inside the region’s biggest stories. Sign up here.

CNN  — 

Turkey’s presidential and parliamentary elections on Sunday will have President Recep Tayyip Erdogan facing unprecedented challenges that could end his two-decade rule.

Voters will decide the fate of Turkey’s democracy less than three months after a February 6 earthquake killed more than 50,000 people and displaced more than more than 5.9 million across southern Turkey and northern Syria.

The elections also take place amid a serious economic crisis and what analysts say is democratic erosion under Erdogan’s government.

Analysts predict a record voter turnout this year, and a tight race between Erdogan and the main opposition candidate Kemal Kilicdaroglu, the leader of the Republican People’s Party (CHP) and presidential nominee for the six-party Nation Alliance bloc.

More than 1.8 million voters living abroad already cast their votes on April 17, Turkish newspaper Daily Sabah reported Wednesday, citing the country’s deputy foreign minister.

Turkey’s demographics are also expected to play a role. Most of the provinces struck by the February earthquake were strongholds of Erdogan and his AK Party. But Supreme Election Council (YSK) chief Ahmet Yener said last month that at least 1 million voters in quake-stricken zones are expected not to vote this year amid displacement.

And even if Kilicdaroglu wins the election, some analysts say Erdogan may not hand over power to his successor without a struggle.

Here’s what you need to know about the vote that could become a pivotal moment in Turkey’s modern history:

How Turkey’s elections work

Turkey holds elections every five years. Presidential candidates can be nominated by parties that have passed the 5% voter threshold in the last parliamentary election, or those who have gathered at least 100,000 signatures supporting their nomination.

The candidate who receives more than 50% of votes in the first round is elected president, but if no candidate gets a majority vote, the election goes to a second round between the two candidates who received the highest number of votes in the first round.

Parliamentary elections take place at the same time as the presidential elections. Turkey follows a system of proportional representation in parliament where the number of seats a party gets in the 600-seat legislature is directly proportional to the votes it wins.

Parties must obtain no less than 7% of votes – either on their own or in alliance with other parties – in order to enter parliament.

The vote will take place Sunday, with candidates casting their ballots for both elections at the same time. The second presidential ballot, if it takes place, will be held on May 28.

Polls open on at 8:00 a.m. local time (1 a.m. ET) and close at 5 p.m. (10 a.m. ET). Results are expected after 9 p.m. (2 p.m. ET) local time.

Who are the contenders?

The pool for this year’s presidential election narrowed to three candidates on Thursday, when Muharrem Ince pulled out of the race.

Apart from Erdogan and Kilicdaroglu, right-wing Ancestral Alliance candidate Sinan Ogan is also running.

Centrist Homeland Party leader Ince said he had withdrawn following a “slander campaign” against him. He has faced weeks of lurid allegations on social media in Turkey and the Ankara public prosecutor’s office said Thursday it had opened an investigation into potential blackmail.

His party, Homeland, will however remain in the parliamentary race.

The 59-year-old ran for president in 2018 but lost against Erdogan. In March this year, he broke away from Kilicdaroglu’s CHP and joined the presidential race. He initially rebuffed calls by his former party to pull out amid concern that he’d take votes away from Erdogan’s rival.

Ince did not endorse any of the remaining candidates, and his name will also remain on the ballot. His withdrawal is a potential boost to Kilicdaroglu.

A lawmaker representing the CHP since 2002 – the same year that saw Erdogan’s AK Party rise to power – Kilicdaroglu, 74, climbed up the political ladder to become his party’s seventh chairman in 2010.

Born in the eastern, Kurdish-majority province of Tunceli, the party leader ran in Turkey’s 2011 general election but lost, coming second to Erdogan and his AK Party.

Kilicdaroglu represents the party formed 100 years ago by Mustafa Kemal Ataturk, the founding father of modern Turkey and a die-hard secularist. He stands in stark contrast to Erdogan’s Islamist-rooted party and its conservative base.

Despite his secular leanings, however, the opposition candidate and his alliance have vowed to represent all factions of Turkish society, which analysts say was demonstrated in his diverse coalition.

What would a change in leadership mean for Turkey’s ties with Russia?

Reacting to Ince’s withdrawal from the race, Kilicdaroglu on Friday accused Russia of interfering in the election campaign.

“Dear Russian friends, you are behind the montages, conspiracies, deep fake content and tapes that were exposed in this country yesterday,” he said on Twitter. “If you want the continuation of our friendship after May 15, get your hands off the Turkish state. We are still in favor of cooperation and friendship.”

The Kremlin’s spokesman, Dmitry Peskov, rejected the accusation in a briefing, calling those who spread such rumors “liars.”

“Russia does not interfere in the internal affairs and electoral processes of other countries,” Peskov said. “We place great value on our bilateral relations with the Turkish side, because the Republic of Turkey has so far taken a very responsible sovereign and well-thought-out position on a whole range of regional and global problems that we are facing.”

Turkey, a NATO member that has the alliance’s second-largest army, has strengthened its ties with Russia in recent years. In 2019, it even bought weapons from the country in defiance of the US.

Erdogan has raised eyebrows in the West by continuing to maintain close ties with Russia as it continues its Ukraine onslaught, and has caused a headache for NATO’s expansion plans by stalling the membership of Finland and Sweden.

When the US Ambassador to Ankara Jeff Flake paid a visit in March to Kilicdaroglu, Erdogan lashed out against him, calling the US diplomat’s visit a “shame,” and warning that Turkey needs to “teach the US a lesson in this election.”

Analysts have said that even if Erdogan is ousted in the polls, a foreign policy u-turn for Turkey is not a given. While figures close to the opposition have indicated that if victorious, it would reorient Turkey back to the West, others say core foreign policy issues are likely to remain unchanged.

Turkey has, however, also been useful to its Western allies under Erdogan. Last year Ankara helped mediate a landmark grains export deal between Ukraine and Russia, and even provided Ukraine with drones that played a part in countering Russian attacks.

What are voters’ main concerns?

High in voters’ list of concerns is the state of the economy and the damage caused by the earthquake. Even before the February disaster, Turkey was struggling with rising prices and a currency crisis that in October saw inflation hit 85%.

That impacted the purchasing power of the public and is “fundamentally the reason why Erdogan’s popularity has been eroded,” said Sinan Ulgen, a former Turkish diplomat and chairman of Istanbul-based think-tank EDAM. “That is going to be the major handicap for Erdogan,” he said.

Voters are also casting their ballots based on whom they see as more capable of managing the fallout from the earthquake, as well as shielding the country from future disasters, analysts say, adding that Erdogan’s popularity had not taken the expected political impact.

“There is a debate about which electoral platform provides the right solution to address these vulnerabilities and enhance Turkey’s resilience to these national disasters,” Ulgen said.

Apart from the economy and the government’s management of Turkey’s frequent natural disasters, voters are likely concerned with Erdogan’s turn away from democracy – something the opposition has campaigned to reverse.

What happens if Erdogan loses?

Some analysts say that if Erdogan loses the vote by a small margin, it opens up the possibility for him to contest the results.

And if past experience is a gauge, then the president and his AK Party may not take a defeat lying down.

During the 2019 Istanbul and Ankara mayoral election, the AK Party lost control of the country’s financial hub and capital, prompting party officials from both cities to reject the results, citing voter irregularities.

The CHP’s lead in Istanbul was a particularly narrow one, and eventually led to the Supreme Electoral Council (YSK) ruling in favor of a re-run that the opposition strongly objected to.

CHP Istanbul mayor candidate Ekrem Imamoglu then went on to win the election re-run, dealing a blow to Erdogan.

Ulgen cast doubt on the YSK’s independence, saying it may give in to potential demands for a recount. The body will be the ultimate arbiter of the race, he said.

A 2023 report by Freedom House said that the judges of the YSK, who oversee all voting procedures, “are appointed by AKP-dominated judicial bodies and often defer to the AKP in their decisions.” The AK Party’s “institutional dominance” in the media and other branches of society also “tilts the electoral playing field” in Erdogan’s favor, the Washington DC-based advocacy group said.

CNN’s Isil Sariyuce in Istanbul contributed to this report.