Istanbul residents vote in mayoral re-run, in key test for Turkish democracy,Erdogan

* Opposition CHP earned narrow win over ruling AKP in March

* Results were annulled, raising concerns over autocracy

* Erdogan back on campaign path hoping to avoid another loss

* Result could bring new round of appeals, protests

By Ezgi Erkoyun and Ali Kucukgocmen

ISTANBUL, June 23 (Reuters) - More than 10 million Istanbul residents will vote on Sunday in a re-run of a mayoral election that has become a referendum on President Tayyip Erdogan's policies and a test of Turkey's ailing democracy.

In the initial March 31 vote, the opposition Republican People's Party (CHP) secured a narrow victory over Erdogan's AK Party (AKP) in Turkey's largest city, a rare electoral defeat for the president amid mounting economic woes.

But after weeks of AKP appeals, Turkey's High Election Board in May annulled the vote citing irregularities. The opposition called the decision a "coup" against democracy, which has raised the stakes for round two.

Erdogan has repeated his line that "whoever wins Istanbul wins Turkey." A second loss in the city, where in the 1990s he served as mayor, would be embarrassing for Erdogan and could weaken what until recently seemed to be his iron grip on power.

Turkey's economy is in recession and the United States, its NATO ally, has threatened sanctions if Erdogan goes ahead with plans to install Russian missile defences.

A second AKP loss could also shed further light into what CHP mayoral candidate Ekrem Imamoglu said was the misspending of billions of lira at the Istanbul municipality, which has a budget of around $4 billion.

"If Imamoglu wins again, there's going to be a chain of serious changes in Turkish politics," journalist and writer Murat Yetkin said.

"It will be interpreted as the beginning of a decline for AKP and for Erdogan as well," he said, noting that the president himself has called the vote "a matter of survival".

Another Imamoglu win could eventually trigger a national election earlier than 2023 as scheduled, a cabinet reshuffle, and even a potential adjustment in foreign policy, Yetkin added.

To narrow the roughly 13,000-vote gap in March, the AKP re-calibrated its message recently to court Kurdish voters, who make up about 15% of Istanbul's 10.5 million voters.

The campaign received a twist when jailed Kurdish militant leader Abdullah Ocalan urged the pro-Kurdish Peoples' Democratic Party (HDP) to stay neutral in the vote. The HDP, which backs Imamoglu, accused Erdogan of trying to divide Kurds.

Voting in Istanbul begins on Sunday at 8 a.m. (0500 GMT) and ends at 5 p.m. Results will be available later in the evening.