ISTANBUL -- First, democracy watchers in Turkey cheered. Now, they're holding their collective breath.
In the country's largest city, Istanbul, all-night, car-honking revelry took place after an opposition candidate won Sunday's closely watched mayoral election in a landslide.
The result, ratified Monday, marked the most humiliating setback in years for Turkey's authoritarian-minded president, Recep Tayyip Erdogan, who had put his own prestige on the line in stumping for the ruling party's candidate.
For the opposition, victory was sweetened by the fact that the vote was a do-over. Its original win nearly three months ago was overturned, seemingly under pressure from Erdogan's ruling Justice and Development Party, or AKP.
Observers called the final outcome a triumph for Turkey's democracy, which has been increasingly beleaguered in recent years under Erdogan. The president has purged or jailed tens of thousands of people after a failed coup against him in 2016.
Critics say Erdogan has politicized the judiciary to target opponents and muzzled once-vibrant free media. In recent years he has also quarreled sharply with the European Union, a bloc Turkey once aspired to join.
The election shows "that not only democracy in Turkey is resilient but also, and more importantly, that it takes a long time to kill a democracy," historian and author Soner Cagaptay of the Washington Institute for Near East Policy wrote on Twitter.
Ekrem Imamoglu of the Republican People's Party, or CHP, won 54% of the vote, soundly beating the AKP's Binali Yildrim, who took 45%. It was a far wider margin of victory than Imamoglu achieved in the original March 31 vote.
Turnout was very high -- 85% -- in part reflecting public unhappiness over the recount that was ordered on technical grounds by the country's highest electoral body, widely suspected of acting at the president's behest.
Erdogan offered congratulations to Imamoglu, and Yildrim conceded graciously even before the votes had all been tallied. But in a sign some read as ominous, Monday-morning headlines in pro-government newspapers made no reference to the opposition victory, instead merely noting that the vote had taken place.