ISTANBUL -- Ekrem Imamoglu, the mayoral candidate from the opposition Republican People's Party (CHP), thanked Istanbul for protecting the more than century-old "tradition of democracy," in a victory speech on Sunday after his rival conceded defeat.
Both Imamoglu, 49, and Binali Yildirim, 63, of the ruling Justice and Development Party (AKP) made televised speeches while vote counting was still under way.
According to state news agency Anadolu, Imamoglu won 54.03% of votes, and Yildirim was at 45.09 per cent, with 99.37% of ballots counted.
Voter turnout was 84.42%, Anadolu said.
Sadi Guven, the chief of the Supreme Electoral Council (YSK), said the final, official result will only be released later Sunday or on Monday.
Imamoglu has sealed his second victory in three months. He won the first mayoral vote on March 31.
But the YSK cancelled the result on May 6, in line with a demand from President Recep Tayyip Erdogan's Islamic-conservative AKP, which alleged irregularities, and ordered a rerun.
The AKP still controls the local parliament, but this second defeat is a stunning loss for Erdogan and the party responsible for the rerun.
They have lost control of Turkey's financial and cultural capital, which has been ruled by Islamic conservatives for 25 years.
They lost the mayoral election in the capital, Ankara, in March.