Turkey's ruling party has lost control of Istanbul after a re-run of the city's mayoral election, latest results show.
The candidate for the main opposition party, Ekrem Imamoglu, won 54% of the vote with nearly all ballots counted.
He won a surprise victory in March which was annulled after the ruling AK party complained of irregularities.
His opponent, 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.
But the result is being seen as a major setback for Mr Erdogan, who has previously said that "whoever wins Istanbul, wins Turkey".
Ambitious mayor takes on Turkish president
In his victory speech, Mr Imamoglu said the result marked a "new beginning" for both the city and the country.
"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."
Mr Imamoglu's lead of more than 775,000 votes marks a huge increase on his victory in March, when he won by a margin of just 13,000.