ISTANBUL (Reuters) - Turkey’s main opposition claimed a decisive victory on Sunday in Istanbul’s re-run election, dealing one of the biggest blows to President Tayyip Erdogan during his 16 years in power and promising a new beginning in the country’s largest city.

Ekrem Imamoglu, mayoral candidate of the secularist Republican People’s Party (CHP), was leading with 54% of votes versus 45% for Erdogan’s AK Party (AKP) candidate, with more than 99% of ballots opened, Turkish broadcasters said.

The election was Istanbul’s second in three months after results of an initial March vote were scrapped, setting up the do-over as a test of Turks’ ability to check what many saw as their president’s increasingly authoritarian power.

“Today, 16 million Istanbul residents have renewed our faith in democracy and refreshed our trust in justice,” Imamoglu told supporters.

His AKP opponent, former Prime Minister Binali Yildirim, congratulated him and wished him “all the luck” in serving Istanbul, Turkey’s commercial hub. Erdogan also tweeted his congratulations to the CHP candidate.

Imamoglu had won the original mayoral election on March 31 by a narrow margin, which prompted the Islamist-rooted AKP to demand a re-run, citing what it said were voting irregularities.

The High Election Board’s decision to grant that request drew sharp criticism from Turkey’s Western allies and from Erdogan’s opponents at home, stirring concerns about the rule of law and raising the stakes for the re-run.

Broadcasters put the CHP’s lead on Sunday at about 800,000 votes, eclipsing the roughly 13,000-vote margin in March.

The election board said it would announce the election results as soon as possible.

“While March 31 was a mayoral election, this re-run was one to put an end to the dictatorship,” said Gulcan Demirkaya, 48, from the city’s AKP-leaning Kagithane district.

“God willing, I would like to see (Imamoglu) as the president in five years’ time,” she said. “The one-man rule should come to an end. For the first time in a long time, I am very happy and proud for my country.”

JUSTICE AND LOVE

Imamoglu, a former businessman and district mayor who waged an inclusive campaign and avoided criticizing Erdogan, said he was ready to work with the AKP to tackle Istanbul’s problems, including its transport gridlock and the needs of its Syrian refugees.

Slideshow ( 25 images )

“In this new page in Istanbul, there will from now on be justice, equality, love, tolerance; while misspending (of public funds), pomp, arrogance and the alienation of the other will end,” he said.

The handover of power in the mayor’s office could shed further light on what Imamoglu said was the misspending of billions of lira at the Istanbul municipality, which has a budget of around $4 billion.

Erdogan himself served as Istanbul’s mayor in the 1990s before he embarked on a national political career, dominating Turkish politics first as prime minister, then as president. He presided over years of strong economic growth. But critics say he has become increasingly autocratic and intolerant of dissent.

Slideshow ( 25 images )

The second defeat in Istanbul marked a major embarrassment for the president and could also weaken what until recently seemed to be his iron grip on power. He had campaigned hard and targeted Imamoglu directly with accusations of lying and cheating.

“This is definitely going to have an impact on the future of Turkish politics given the margin of victory. It’s an alarming sign for the AKP establishment,” said Sinan Ulgen, visiting scholar at Carnegie Europe in Brussels and a former Turkish diplomat.

Analysts say the loss could set off a Cabinet reshuffle in Ankara and adjustments to foreign policy. It could even trigger a national election earlier than 2023 as scheduled, although the leader of the AKP’s nationalist ally played down that prospect.

“Turkey should now return to its real agenda, the election process should close,” MHP party leader Devlet Bahceli said. “Talking of an early election would be among the worst things that can be done to our country.”

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.

The uncertainty over the fate of Istanbul and potential delays in broader economic reforms have kept financial markets on edge.

Turkey’s lira currency tumbled after the decision to annul the March vote and is down nearly 10% this year in part on election jitters. It edged higher on Sunday night.