Turkey’s ruling AK Party has lost control of Istanbul after a re-run of the city’s mayoral election.
With nearly all ballots counted, main opposition party candidate Ekrem Imamoglu had a lead of 775,000 votes, a huge increase on the margin of 13,000 he achieved in the earlier election.
That victory in March was annulled after the AKP alleged irregularities.
AKP candidate, ex-PM Binali Yildirim, has conceded. President Recep Tayyip Erdogan congratulated the winner.
“I congratulate Ekrem Imamoglu who has won the election based on preliminary results,” he tweeted.
The result is being seen as a major setback for Mr Erdogan, who has previously said that “whoever wins Istanbul, wins Turkey”.
In his victory speech, Mr Imamoglu, of the Republican People’s Party (CHP), said the result marked a “new beginning” for both the city and the country. He said his supporters had “fixed democracy”.
“We are opening up a new page in Istanbul,” he said. “On this new page, there will be justice, equality, love.”
He added that he was willing to work with Mr Erdogan, saying: “Mr President, I am ready to work in harmony with you.”
With 99% of votes counted, Mr Imamoglu had 54% of the vote and Mr Yildirim 45%.
President Erdogan – the most powerful leader Turkey has seen in modern times – has just been dealt the biggest blow of his career.
This result shows that he made an incredible miscalculation by calling for the election to be re-run.
It will likely hasten splits in his ruling AKP and amplify talk of the post-Erdogan era. He will stress that he’s in power for the foreseeable future – elections are not scheduled until 2023 – but many will expect them earlier. The result in Istanbul feels like it could be a precursor to them.
So how did the opposition win? Ekrem Imamoglu gave people the profoundly positive message they craved and rebuffed smears with smiles. It was hugely effective, and showed the CHP has finally worked out how to counter the president.
It has waited 25 years to control this city and long felt incapable of success. It is savouring this moment – after all, it could be a watershed one.
Who were the candidates?
Mr Imamoglu, 49, is the mayor of Istanbul’s Beylikduzu district but his name was barely known before he ran in the March election.
Mr Yildirim was a founding member of Mr Erdogan’s AKP and was prime minister from 2016 until 2018, when Turkey became a presidential democracy and the role ceased to exist.
He was elected Speaker of the new parliament in February and before that served as minister of transportation and communication.
Why was the previous result annulled?
Mr Imamoglu’s victory of 13,000 votes in March was not enough for Mr Yildirim to accept defeat.
The ruling party alleged that votes were stolen and many ballot box observers did not have official approval, leading the election board to demand a re-run of the vote.
Critics argue that pressure from President Erdogan was behind the decision.
Jubilation on the streets
By Cagil Kasapoglu, BBC Turkish, Istanbul
Hundreds of supporters of Mr Imamoglu gathered in his stronghold, Besiktas. The cautious optimism that was prevalent during the early stages of vote counting gave way to a mood of total jubilation.
Hopeful youngsters celebrated and proudly waved Turkish flags. Others held banners with pictures of Atatürk – the founder of the modern Turkish republic – on them. Some even wore masks of Mr Imamoglu.
Many of these young people have only ever known President Erdogan’s AKP in government.
For them, this is an opportunity to push for change across the country.
“Many young people desperately want to leave Turkey,” Ayca Yilmaz, a 22-year-old university student told me. “But now, we might consider staying here. We are hopeful once again.”