FILE  - In this Friday, June 21, 2019 file photo, Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, waves to supporters during a rally in Istanbul, ahead of the June 23 re-run of Istanbul elections.Voters in Istanbul return to the polls on Sunday for a rerun of the election for the mayor of the city. (AP Photo/Lefteris Pitarakis, File)

ISTANBUL (AP) — Voters in Istanbul return to the polls Sunday for a rerun of the Turkish city's mayoral election. Turkey's top election authority voided the first vote, which an opposition candidate narrowly won.

President Recep Tayyip Erdogan's party challenged the March 31 vote, alleging irregularities. The political opposition insists victory was wrongly snatched away from the candidate who had been sworn into office.

Here's a look at the tightly contested race seen by many as a test for democracy in this country of nearly 80 million people.

THE VOTE

The election is taking place again because Turkey's electoral board ordered a rerun after ruling in favor of the governing party, on the grounds that some officials overseeing the vote were not civil servants as required by law. The decision raised questions over Turkey's democratic process and whether Erdogan's ruling party, in power since 2002, would be willing to accept electoral defeat.

Sunday's vote is to elect the mayor of Istanbul only, unlike the election in March when voters across the country chose mayors, municipal assemblies, and neighborhood administrators.

Around 10.56 million people are eligible to vote Sunday. 

THE CITY

Erdogan has famously said: "Whoever wins Istanbul, wins Turkey" and "Whoever loses Istanbul, loses Turkey." Erdogan's rise to power began as Istanbul mayor in 1994.

The city of more than 15 million residents is Turkey's largest, straddling both Europe and Asia. It draws millions of tourists each year and is the country's commercial and cultural hub.

The sprawling city accounted for 31% of Turkey's GDP in 2017. The Istanbul metropolitan municipality and its subsidiaries had a total budget of $8.8 billion last year.

The municipality, which has been run by the conservative ruling party and its Islamic-oriented predecessor for 25 years, has awarded lucrative contracts to businesses considered to be close to the government and offers huge financial resources and employment opportunities.

THE CANDIDATES

Twenty-one people are officially running for mayor but the race is essentially between two men: Ekrem Imamoglu and Binali Yildirim.

Imamoglu, from the secular Republican People's Party, CHP, won the annulled vote by a narrow margin of just 13,729 votes in a surprise victory over his ruling party rival. The 49-year-old is a former contractor and ex-mayor of the district of Beylikduzu in Istanbul. He served as Istanbul's mayor for just 18 days before his victory was annulled. He is also backed by the nationalist Good Party.

Binali Yildirim, 63, is the candidate for the governing Justice and Development Party, AKP. A former prime minister and transport minister, he resigned as parliament speaker to run in the March 31 local government elections. He's also backed by the AKP ally, the Nationalist Movement Party.

As in the March poll across Turkey, the Kurdish vote is key. A pro-Kurdish party, second largest opposition group in parliament, is again sitting the race out in a strategy seen as favoring Imamoglu.

THE CONTROVERSY

The March vote was rife with controversy that started on election night. Turkey's official Anadolu news agency suspended its results service as the opposition candidate began to narrow the gap, drawing widespread criticism that it was partial toward the government. Both Imamoglu and Yildirim declared victory on the night.

Erdogan's governing party filed a series of objections to the results citing alleged voting irregularities. Imamoglu received a mandate to serve as mayor on April 17 when the ensuing recounts failed to alter the results. He was stripped of it on May 6.

Voting 7-4, the election board annulled the Istanbul mayoral election on the grounds that some polling stations were not headed by civil servants. Before the elections however, parties had time to appeal alleged violations but had not objected to staffing at those polling stations. 

THE CAMPAIGN

President Erdogan spoke at numerous rallies ahead of the March vote across Turkey, appealing to nationalist and religious sentiments, describing the elections a fight for national survival. But Turkish voters are grappling with economic uncertainty and rising food prices.

Both Imamoglu and Yildirim have worked hard to reach Istanbul residents through neighborhood meetings. They've also made visits to homes during what has been the month of Ramadan to break their fasts with voters after sunset.

Yildirim has struggled to explain the need for a repeat election. He has promised to build on the government's achievements in improving Istanbul's infrastructure and services.

Imamoglu, on the other hand, argues that the AKP squandered the city's resources to the benefit of a powerful inner circle of government backers, and is promising social policy reforms to try and lift a quarter of Istanbul residents out of poverty. He is leading a mild mannered campaign despite attacks from the pro-government news media.

___

Follow Bilginsoy at http://twitter.com/zbilginsoy  

FILE-In this Friday, June 21, 2019 file photo, supporters of Binali Yildirim, mayoral candidate for Istanbul from Turkey's ruling Justice and Development Party, AKP, attend a rally in Istanbul, ahead of June 23 re-run of mayoral elections. Voters in Istanbul return to the polls Sunday for a rerun of an election for mayor of the city. (AP Photo/Lefteris Pitarakis, File)
Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, acknowledges his supporters from atop his campaign bus, during a rally in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections. The 49-year-old candidate won the March 31 local elections with a slim majority, but after weeks of recounting requested by the ruling party, Turkey's electoral authority annulled the result of the vote, revoked his mandate and ordered the new election.(AP Photo/Lefteris Pitarakis)
People walk near Golden Horn in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections. Millions of voters in Istanbul go back to the polls for a controversial mayoral election re-run Sunday, as President Recep Tayyip Erdogan's party tries to wrestle back control of Turkey's largest city. Suleymaniye Mosque is in the background. (AP Photo/Burhan Ozbilici)
Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, reaches out from his campaign bus to shake hands with supporters following a rally in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections.The 49-year-old candidate won the March 31 local elections with a slim majority, but after weeks of recounting requested by the ruling party, Turkey's electoral authority annulled the result of the vote, revoked his mandate and ordered the new election.(AP Photo/Lefteris Pitarakis)
Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, acknowledges his supporters from atop his campaign bus, during a rally in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections. The 49-year-old candidate won the March 31 local elections with a slim majority, but after weeks of recounting requested by the ruling party, Turkey's electoral authority annulled the result of the vote, revoked his mandate and ordered the new election.(AP Photo/Lefteris Pitarakis)
FILE- In this Friday, June 21, 2019 file photo, Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, waves to supporters during a rally in Istanbul, ahead of the June 23 re-run of Istanbul elections. Voters in Istanbul return to the polls on Sunday for a rerun of the election for the mayor of the city. (AP Photo/Lefteris Pitarakis, File)
In this Friday, June 21, 2019 file photo, Binali Yildirim, mayoral candidate for Istanbul from Turkey's ruling Justice and Development Party, AKP, salutes supporters following a rally in Istanbul, ahead of the June 23 re-run of mayoral elections. Voters in Istanbul return to the polls on Sunday for a rerun of the election for the mayor of the city. (AP Photo/Lefteris Pitarakis)
In this Friday, June 21, 2019 file photo, Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, waves to supporters during a rally in Istanbul, ahead of the June 23 re-run of Istanbul elections. Voters in Istanbul return to the polls on Sunday for a rerun of the election for the mayor of the city. (AP Photo/Lefteris Pitarakis, File)
FILE-In this Friday, June 21, 2019 file photo, supporters of Binali Yildirim, mayoral candidate for Istanbul from Turkey's ruling Justice and Development Party, AKP, attend a rally in Istanbul, ahead of the June 23 re-run of mayoral elections. Voters in Istanbul return to the polls Sunday for a rerun of an election for mayor of the city. (AP Photo/Lefteris Pitarakis, File)
FILE - In this Tuesday, June 11, 2019 file photo, Binali Yildirim, left, mayoral candidate for Istanbul from Turkey's ruling Justice and Development Party, speaks with a woman as he visits a market before the June 23 re-run elections, in Istanbul. Voters in Istanbul return to the polls Sunday for a rerun of an election for mayor of the city. (AP Photo/Burhan Ozbilici, File)
In this Wednesday, June 19, 2019 photo, supporters of Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP watch him delivering a speech during a rally in Istanbul, ahead of the June 23 re-run of Istanbul elections. The 49-year-old candidate won the March 31 local elections with a slim majority, but after weeks of recounting requested by the ruling party, Turkey's electoral authority annulled the result and ordered the new election. (AP Photo/Lefteris Pitarakis)
File- In this Friday, June 21, 2019 file photo, supporters of Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, cheer during his speech a rally in Istanbul, ahead of the June 23 re-run of mayoral elections.The 49-year-old candidate won the March 31 local elections with a slim majority, but after weeks of recounting requested by the ruling party, Turkey's electoral authority annulled the result of the vote, revoked his mandate and ordered the new election .(AP Photo/Lefteris Pitarakis, File)
In this Wednesday, June 19, 2019 photo, Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, waves to supporters as he speaks at a rally in Istanbul, ahead of the June 23 re-run of Istanbul elections. The 49-year-old candidate won the March 31 local elections with a slim majority, but after weeks of recounting requested by the ruling party, Turkey's electoral authority annulled the result of the vote, revoked his mandate and ordered the new election. (AP Photo/Lefteris Pitarakis)
In this Friday, June 21, 2019 file photo, Binali Yildirim, mayoral candidate for Istanbul from Turkey's ruling Justice and Development Party, AKP, takes photos with supporters following a rally in Istanbul, ahead of the June 23 re-run of mayoral elections. Voters in Istanbul return to the polls on Sunday for a rerun of the election for the mayor of the city. (AP Photo/Lefteris Pitarakis)
Supporters of Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, cheer during his speech a rally in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections.The 49-year-old candidate won the March 31 local elections with a slim majority, but after weeks of recounting requested by the ruling party, Turkey's electoral authority annulled the result of the vote, revoked his mandate and ordered the new election.(AP Photo/Lefteris Pitarakis)
Supporters of Binali Yildirim, mayoral candidate for Istanbul from Turkey's ruling Justice and Development Party, AKP, attend a rally in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of mayoral elections. (AP Photo/Lefteris Pitarakis)
Supporters of ruling Justice and Development Party wave national flags in main Taksim Square in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections. Millions of voters in Istanbul go back to the polls for a controversial mayoral election re-run Sunday, as President Recep Tayyip Erdogan's party tries to wrestle back control of Turkey's largest city. (AP Photo/Burhan Ozbilici)
Ekrem Imamoglu, secular candidate from Turkey's main opposition Republican People's Party, addresses a meeting in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections. Millions of voters in Istanbul go back to the polls for a controversial mayoral election re-run Sunday, as President Recep Tayyip Erdogan's party tries to wrestle back control of Turkey's largest city. The banner reads:
A poster of Binali Yildirim, mayoral candidate of ruling Justice and Development Party seen hang on a building in city's landmark Istiklal Street, in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections. Millions of voters in Istanbul go back to the polls for a controversial mayoral election re-run Sunday, as President Recep Tayyip Erdogan's party tries to wrestle back control of Turkey's largest city. Suleymaniye Mosque is in the background. (AP Photo/Burhan Ozbilici)
People walk near Golden Horn in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections. Millions of voters in Istanbul go back to the polls for a controversial mayoral election re-run Sunday, as President Recep Tayyip Erdogan's party tries to wrestle back control of Turkey's largest city. Suleymaniye Mosque is in the background. (AP Photo/Burhan Ozbilici)
Ekrem Imamoglu, candidate of the secular opposition Republican People's Party, or CHP, reaches out from his campaign bus to shake hands with supporters following a rally in Istanbul, Friday, June 21, 2019, ahead of June 23 re-run of Istanbul elections.The 49-year-old candidate won the March 31 local elections with a slim majority, but after weeks of recounting requested by the ruling party, Turkey's electoral authority annulled the result of the vote, revoked his mandate and ordered the new election.(AP Photo/Lefteris Pitarakis)