Ankara: Turkish President Recep Tayyip Erdogan's party has lost control of the capital in local elections in what is being seen as a setback to his 16 years in power.
Sunday's election came amid an economic downturn and was widely seen as a referendum on his leadership.
According to Turkish media, the secularist Republican People's Party (CHP) candidate Mansur Yavas won a clear victory in Ankara.
However, both the CHP and Erdogan's AKP or Justice and Development Party claimed victory by a slender margin in the contest for Mayor of Istanbul, which has been governed by AKP, the BBC reported.
CHP candidate Ekrem Imamoglu said he won by nearly 28,000 votes while the AKP said its candidate, former Prime Minister Binali Yildirim, was ahead by 4,000 votes.
Both candidates reportedly received more than four million votes each.
The CHP also said it held Izmir, Turkey's third largest city.
Nationally, the President's AKP-led alliance won more than 51% of the vote in the municipal election.
"If there are any shortcomings, it is our duty to correct them," he said. He previously said the poll was about the "survival" of the country and his party.
CHP leader Kemal Kilicdaroglu said: "The people have voted in favour of democracy. They have chosen democracy."
Meanwhile, Erdogan, speaking to supporters in Ankara, hinted that the AKP may have lost control of Istanbul.
"Even if our people gave away the mayoralty, they gave the districts to the AK Party," he said.
He vowed to focus his leadership on the Turkish economy ahead of national elections scheduled to take place in 2023.