Voters wait in the line for cast their ballots at a polling station during the local elections in Ankara, Turkey, Sunday, March 31, 2019. Turkish citizens have begun casting votes in municipal elections for mayors, local assembly representatives and neighborhood or village administrators that are seen as a barometer of Erdogan's popularity amid a sharp economic downturn. Photo: AP Photo/Ali Unal.

Istanbul - Turkey voted in local elections on Sunday in a test for President Recep Tayyip Erdogan, with his ruling party risking defeat in the capital as an economic slowdown takes hold.

Erdogan and his Justice and Development Party (AKP) have won every vote since the party first came to power in 2002 but this time, analysts say the party could lose Ankara and even Istanbul.

Sunday's poll was the first municipal ballot since Turks approved constitutional reforms in 2017 to create an executive presidency that gave Erdogan wider powers after a decade and a half in office.

But Erdogan, whose ability to win continuously at the ballot box is unparalleled in Turkish history, appears more vulnerable with the country's economy in recession, unemployment up and inflation in double digits.

Much of the AKP's success has been down to his perceived economic prowess, but days before the vote, the Turkish lira was sliding again, provoking memories of the 2018 currency crisis that badly hurt Turkish households.

Erdogan, who began his own political career as Istanbul mayor, campaigned hard across Turkey, often with several rallies a day, even though he is not on the ballot.

Looking to rally his base among conservative Turks, the president cast the election as a matter of survival, attacking opposition candidates by branding them as linked to PKK Kurdish militants.

"The economy is terrible," said Husnu Acar, 53, after voting in a school in Beylikduzu on the outskirts of Istanbul.

"They are the ones with a survival problem," he said of the AKP.

Voters are to elect scores of mayors, municipal councils and other local officials. Preliminary results are expected soon after polls close with official results released early in the week.

Two members of Saadet (Felicity), a religiously conservative party, were killed after an attack by an AKP candidate's nephew in a polling station in Malatya, eastern Turkey, Saadet chairman Temel Karamollaoglu said on Twitter. 

The two men, one of whom was also an election observer, died after a fight between two groups in Puturge district, private DHA news agency reported. The Malatya governorate said four individuals were detained.

Erdogan said the incident was "upsetting" after he voted in Istanbul, and he called Karamollaoglu shortly afterwards to offer his condolences, the presidency said.

- Charges of an unfair vote -

For his supporters, Erdogan remains the strong leader they believe Turkey needs and they tout the country's economic development over the 16 years he and the AKP have been in power. 

But rights activists and even Turkey's Western allies say that under his leadership, democracy has been eroded, particularly after a failed 2016 coup that led to tens of thousands of people being arrested.

"The economy isn't doing so good for sure, but I have confidence in our president and things will be better after the election," said Koksal Karacan, a retiree voting in Istanbul's Kasimpasa, where Erdogan grew up.

The vote will be the first time since 2002 that the AKP is fielding candidates with its alliance partner, the rightwing Nationalist Movement Party (MHP).

The opposition pro-Kurdish Peoples' Democratic Party (HDP) has refused to field candidates in several cities, saying the elections are unfair. Some of its leaders have been jailed on terror charges, accusations they reject.

The HDP criticised the detentions of candidates and its members in the run-up to the vote in a statement on Sunday, accusing the government of trying "to paralyse the HDP organisationally, and render the playing field even more uneven".

Critics say that with most media either pro-government or controlled by the president's supporters, opposition parties campaigned at a disadvantage because Erdogan's daily rallies dominated TV coverage.

"What has happened during the campaign for Sunday's local elections is unprecedented and demonstrates that -- unlike during its first years in power -- the AKP is no longer confident of being able to win a fair election," said Gareth Jenkins, a non-resident senior research fellow at the Silk Road Studies Programme.

- 'Boss of the economy' -

In Istanbul, the country's biggest city and its economic hub, Erdogan has fielded one of his loyalists, former prime minister Binali Yildirim.

But in Ankara, Mansur Yavas -- the candidate for both the opposition Republican People's Party or CHP and the nationalist Good Party -- might have a stronger chance of winning, according to recent polls.

With inflation at just under 20 percent and unemployment at a near 10-year high in December, Erdogan has sought to reassure voters about the economy.

"I am the boss of the economy right now as the president of this country," Erdogan told a rally on Saturday.

Turkey's finance minister, Berat Albayrak, who is Erdogan's son-in-law, said economic reforms would be announced the week of April 8.

AFP