President Recep Tayyip Erdogan lost the mayoral race in the capital Ankara to Turkey's secular opposition as the country staged pivotal local elections.
Erdogan declared victory in the elections on Sunday night but the opposition's success in Ankara and elsewhere dealt a significant blow to his party's dominance.
Votes are still being counted in Istanbul where the race for mayor is said to be 'too close to call'.
The candidate of the main opposition Republican People's Party (CHP) in Turkey's largest city Istanbul is ahead in the vote count against the candidate of President Tayyip Erdogan's AK Party (AKP), the head of the country's High Election Board said on Monday.
Erdogan, prepares to cast his ballot during the local elections in Istanbul on Sunday surrounded by members of his party
Ekrem Imamoglu, the mayoral candidate for Istanbul representing the Republican People's Party (CHP) looks set to win the city according to the latest vote counts
Sadi Guven told reporters that the CHP's Ekrem Imamoglu had 4,159,650 votes and the AKP's Binali Yildirim had 4,131,761 votes. He did not specify which percentage of votes had been counted.
Sunday's local elections were widely seen as a test of support for Erdogan as the nation of 81 million people faces a daunting economic recession with double-digit inflation, rising food prices and high unemployment.
The main opposition party winning the race for metropolitan mayor in Ankara marks a symbolic shift. The capital city was held by Erdogan's Justice and Development Party, the AKP, and its Islamic-oriented predecessor for 25 years.
More than 57 million voters were eligible to take part in choosing the mayors of 30 major cities, 51 provincial capitals and 922 districts in Turkey. In big cities, voters cast four ballots, for metropolitan mayor, district mayor, the municipal assembly and a neighborhood administrator.
According to unofficial results reported by the state-run Anadolu news agency, Mansur Yavas, the candidate of the secular Republican People's Party, or CHP, won the top post in Ankara. The AKP still holds a majority of Ankara's 25 districts.
Election officials start counting ballots at a polling station during the local elections in Ankara which were lost by Erdogan's party
An official inspects one of the ballot papers during counting for the local elections in Ankara on Sunday evening
Ballots are transported after being counted at a polling station during the local elections in Diyarbakir
The government had led a hostile campaign against Yavas and his