Results are so far extremely close in Turkey’s local elections, which are widely seen as a referendum on President Recep Tayyip Erdogan.
The opposition CHP candidate for mayor has claimed a narrow victory in Ankara, where 91.4% votes have been counted.
In Istanbul , the governing AK Party said it had won a tight victory by just one point, with 48.7% of the vote compared to CHP’s 48.6%.
The CHP said this was premature, and an attempt to manipulate the public.
More than 57 million people in the country were registered to vote for mayors and councillors in the election, which came amidst an economic downturn.
Despite the closeness of the race so far, Mr Erdogan declared that his AK Party (Justice and Development Party, AKP) had come “top by far”.
“Results show that, as the AKP, we emerged from this election as the top party by far, just as has been the case since the 3 November 2002 election,” he told a press conference in Istanbul.
He had previously said the poll was about the “survival” of the country and his party, which has dominated politics for 16 years.
This was the first municipal vote since Mr Erdogan assumed sweeping executive powers through last year’s presidential election.
But polls in the lead-up to the election had already showed a tight contest emerging in Ankara between the CHP mayoral candidate Mansur Yavas and AKP candidate Mehmet Ozhaseki.
In election-related violence, dozens of people were injured in clashes across Turkey. Two people were shot dead at a polling station in the eastern city of Malatya. Local reports say a fight broke out after a man refused to use a polling booth, preferring to vote in the open.
‘Punishment for deepening recession’
Analysis by Mark Lowen, BBC Turkey Correspondent
There is a saying in Turkish: whoever wins Istanbul wins Turkey.
Tonight, the biggest prize in the local elections is too close to call, with fewer than 3,000 votes between the governing AK Party and the opposition CHP in a city of 18 million people.
The AKP candidate has declared victory, but there are still votes to count.
In the capital Ankara, the opposition has won back control after a quarter of a century. If it takes Istanbul too, it would be an astonishing result in a country where 90% of the media is pro-government and President Erdogan has branded his opponents “terrorists”.
His usually loyal conservative voters have punished him for a deepening recession, with inflation at 20% and the currency plunging in value.
For years Mr Erdogan appeared unbeatable, with a moribund opposition. Tonight, that image is beginning to change.
How was the campaign?
The AKP have won every election since coming to power in 2002, but analysts say this is the first time the party is no longer confident of its success.
With most media either pro-government or controlled by Mr Erdogan’s supporters, critics believe opposition parties campaigned at a disadvantage.
The opposition pro-Kurdish Peoples’ Democratic Party (HDP) said the elections were unfair and refused to put forward candidates in several cities.
Some of its leaders have been jailed on terror charges, accusations they reject.
Mr Erdogan’s rallies have dominated TV coverage. At one on Saturday, the president sought to reassure voters and the party’s usually conservative supporters that everything was under control.
“I am the boss of the economy right now as president of this country,” he said, also blaming the West and particularly the US for its financial turbulence.
The president was criticised for repeatedly showing footage from the recent terror attack in New Zealand, in which a self-declared white supremacist live-streamed himself killing 50 people at two Christchurch mosques.
He warned citizens of those coming to Turkey with anti-Muslim sentiments, sparking a diplomatic row after invoking memories of Turkey’s dead in the battle of Gallipoli by Australian and New Zealand forces in 1915.