Turkey's ruling party candidate for Istanbul mayor claimed victory in a race that near total results in Sunday's election showed was a dead heat.
"We have won the election in Istanbul. We thank Istanbul's residents for the mandate they have given us," Binali Yildirim, a former premier and loyalist of President Recep Tayyip Erdogan, told supporters.
The AKP candidate had 48.71 percent of votes against 48.65 for his opponent Ekrem Imamoglu, with 98 percent of ballot boxes counted.
Turkey's main opposition party appeared on course to seize control of Ankara in Sunday's local elections and defeat President Tayyip Erdogan's ruling AK Party in the capital for the first time since Erdogan came to power 16 years ago.
After three-quarters of ballot boxes were opened, secularist opposition Republican People's Party (CHP) mayoral candidate Mansur Yavas had 49.8 percent of the vote, 2.0 percentage points ahead of his AKP rival.
While the AK Party looked set to hold Istanbul, Turkey's largest city, defeat in Ankara would be a major setback for Erdogan who campaigned relentlessly for two months ahead of a vote which he described as a "matter of survival" for Turkey.
Erdogan has dominated Turkish politics for more than 16 years thanks mainly to strong economic growth and support from a core constituency of pious, conservative Muslim Turks.
A consummate campaigner, he has been the country's most popular - though also divisive - modern politician, tightening his hold on power in elections last year which ushered in a new executive presidency, approved in a bitterly fought 2017 referendum.