Turkey's opposition has dealt President Recep Tayyip Erdogan a stinging blow by winning control of Istanbul in a re-run mayoral election, breaking his aura of invincibility and delivering a message from voters unhappy over his ever-tighter grip on power.
Ekrem Imamoglu of the secularist Republican People's Party (CHP) secured 54.21% of votes, the head of the High Election Board announced on Monday - a far wider victory margin than his narrow win three months ago.
The previous result was annulled after protests from Erdogan's Islamist-rooted AK Party, which said there had been widespread voting irregularities. The decision to re-run the vote was criticized by Western allies and caused uproar among domestic opponents who said Turkey's democracy was under threat.
On Sunday and in the early hours Monday, tens of thousands of Imamoglu supporters celebrated in the streets of Istanbul after the former businessman triumphed over Erdogan's handpicked candidate by almost 800,000 votes.
"In this city today, you have fixed democracy. Thank you, Istanbul," Imamoglu told supporters who made heart signs with their hands, in an expression of the inclusive election rhetoric that has been the hallmark of his campaigning.
"We came to embrace everyone," he said. "We will build democracy in this city; we will build justice. In this beautiful city, I promise, we will build the future."
Erdogan congratulated him for the victory and Imamoglu's rival, Binali Yildirim of the ruling AK Party (AKP), wished him luck as mayor barely two hours after polls closed.
Erdogan has ruled Turkey since 2003, first as prime minister and then as president, becoming the country's most dominant politician since its founder, Mustafa Kemal Ataturk, nearly a century ago.
His AKP has strong support among pious and conservative Turks and its stewardship of Turkey's economy through a decade and a half of construction-fueled growth helped Erdogan win more than a dozen national and local elections.
But economic recession and a financial crisis have eroded that support and Erdogan's ever-tighter control over government has alarmed some voters.
Turkey's lira tumbled after the decision to annul the March vote and is down 8% this year, in part on election jitters.
But assets rallied on Monday as investors welcomed the removal of one source of political uncertainty. The lira firmed 1% against the dollar, shares rose nearly 2% and bond yields fell.
Imamoglu won support even in traditionally pious Istanbul districts, once known as AK Party strongholds, ending the 25-year-long Islamist rule in the country's largest city.
"This re-run (election) was one to put an end to the dictatorship," said Gulcan Demirkaya, a 48-year-old housewife in Istanbul's AKP-leaning Kagithane district. "God willing, I would like to see him as the president in five years' time. The one-man rule should come to an end."
The results are likely to trigger a new chapter in Turkish politics, now that the country's top three cities now held by the opposition. Cracks could also emerge within Erdogan's AKP, bringing the economic troubles more to the fore.
"This is definitely going to have an impact on the future of Turkish politics given the margin of victory. It's alarming sign for the AKP establishment," said Sinan Ulgen, visiting scholar at Carnegie Europe in Brussels and former Turkish diplomat.
Analysts say the loss could set off a Cabinet reshuffle in Ankara and adjustments to foreign policy. The leader of the AKP's nationalist ally played down the prospect that the loss could even trigger a national election earlier 2023, when the next polls are scheduled.
"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."
The uncertainty over the fate of Istanbul and potential delays in broader economic reforms have kept financial markets on edge. Threats of sanctions by the United States if Erdogan goes ahead with plans to install Russian missile defenses have also weighed on the markets.
A Council of Europe delegation said its observers were given a "less than friendly reception" in some places and had "too many unnecessarily aggressive and argumentative encounters to ignore," but that the election was conducted competently.
"The citizens of Istanbul elected a new mayor in a well-organized and transparent vote, albeit in tense circumstances," delegation head Andrew Dawson said in a statement.