ISTANBUL (AFP) — Turkey’s Premier Recep Tayyip Erdogan, embattled by protests and corruption scandals, faces a crucial popularity test Sunday when over 50 million eligible voters cast their ballots in local elections.

Hailed as the “sultan” by his loyal followers and labeled a “dictator” by his bitter foes, Erdogan has campaigned for weeks alongside mayoral candidates, turning the vote into a referendum on his 11-year rule.

The outcome — especially in the mega-city Istanbul and capital Ankara — will impact his future as he eyes a run for the presidency in August, or changing party rules to seek a fourth term as prime minister next year.

The past 10 months have spelled crisis for Erdogan, a leader long hailed at home and abroad for driving economic growth and turning the country spanning Europe and Asia into an emerging global player.

But the secular urban middle-class has been alienated since police harshly cracked down on protesters in Istanbul’s Gezi Park last June, sparking off weeks of street clashes that left eight people dead and thousands wounded.

The harsh response fueled a growing perception of an autocratic leader seeking “one-man rule” while falling out with former allies — especially the influential Pennsylvania-based Muslim cleric Fethullah Gulen, now his declared arch-enemy.

Erdogan has accused the 73-year-old imam, and his loyalists in the Turkish police force and justice system, of being behind a spate of wiretaps and social media leaks exposing graft and high-level security talks weighing military action in Syria.

The government’s response — especially blocking Twitter and YouTube in the past two weeks — has sparked a chorus of condemnation from Turkey’s NATO allies and human rights groups.

“We will teach a major lesson to Pennsylvania, to those who tapped the telephones,” Erdogan vowed on the eve of the polls. “They are traitors … they are spies … We will emerge stronger again, God willing!”

‘Politics of fear and conspiracy’

As the local elections neared, Erdogan has often said that “whoever wins Istanbul wins Turkey.”

Judging by the enthusiastic crowd welcomes the former mayor received Saturday — with followers loudly cheering him, some climbing trees to catch a glimpse — his conservative Justice and Development Party (AKP) seemed to have a good shot at continuing its run of election victories here.

Many love the “tall man” who has left his mark on the Istanbul skyline with multi-billion-dollar mega-projects, including a new bridge and tunnel across the Bosphorus strait, and who plans to build the world’s biggest airport near the city.

Despite growing criticism of Erdogan as authoritarian, he still commands the loyalty of millions, as well as a rich campaign war-chest and an incumbent’s grip on much of the national media, say analysts.

“Erdogan and the AKP have a large core base of support that will back him up no matter what,” said Brent Sasley, a Middle East expert at the University of Texas.

At the same time, he said, “Erdogan’s grip has certainly been weakened … a longer-term process that began with the Gezi protests.

“There is no doubt that the corruption scandals have raised serious questions for many Turks about his pristine image and the quality of the AKP.”

The spiraling crisis has sent down the Turkish lira and stocks and rattled investors’ faith in the Muslim democracy long hailed as a model for post-Arab Spring countries.

With memories fresh in Turkey of riot police using tear gas, truncheons and rubber bullets against demonstrators, many people are nervous that unclear or contested vote results could again bring tensions to the boil.

“To put it very bluntly, what is going on in Turkey now is a power struggle of historic proportions, and it would be rather surprising if this power struggle ends smoothly and easily after the elections,” Inan Demir, chief economist at Finansbank, said.

“If anything, political tensions might escalate even further ahead of presidential elections in August.”

Sasley said that, whatever happens next in Turkey’s tumultuous politics, already “the damage has been great and won’t be fixed for some time to come … The politics of fear and conspiracy have been embedded even more deeply into Turkish politics.”