Mr Erdogan's rallies dominated TV coverage.
Despite winning the mayoral elections in key Turkish cities, Ankara and Istanbul, controlled by the ruling party for the past 25 years, the opposition will have to work hard under government's scrutiny because President Erdogan and his AK party remain strong, experts told Sputnik.
Although Erdogan was not running for office Sunday, he became the face of the campaign, rallying tirelessly for months across Turkey, using hostile rhetoric against opposition parties and portraying the vote as a matter of national survival.
Sadi Guven, the head of Turkey's high election board, told reporters that the opposition candidate, Ekrem Imamoglu, was leading his competitor, Binali Yildirim, by almost 28,000 votes.
Prime Minister Imran Khan also congratulated Erdogan on another important victory in Sunday's local elections.
Calling him a "friend of Pakistan", Premier Khan added, "The people of Pakistan wish him many more successes".
Supporters of opposition Republican People's Party (CHP) celebrate after early results of the local election in Ankara.
"The people have voted in favor of democracy, they have chosen democracy", opposition leader Kemal Kilicdaroglu said, declaring that his secularist CHP had taken Ankara and Istanbul from the AK Party (AKP) and held its Aegean coastal stronghold of Izmir, Turkey's third largest city. The possibility of losing Istanbul, where he launched his political career and served as mayor in the 1990s, was an even greater shock.
On Tuesday the lira weakened as much as 2 percent against the dollar on concerns about renewed tensions with the United States after it halted delivery to Turkey of equipment related to the F-35 fighter aircraft.
Yildirim accepted that his rival was leading but said his party would file an objection, suggesting a recount of the 319 500 votes declared void in Istanbul.
All votes have reportedly been counted in those cities.
Both the ruling party and the opposition claimed victory in the neck to neck race in Istanbul.
The party is also contesting results in 25 districts in Ankara, said Hakan Han Ozcan who heads the AKP in the capital.
"There's an economic crisis, there's an worldwide crisis due to an ongoing stand-off with the US". In 2017 he gained sweeping new powers in a narrowly won referendum that was widely condemned as a power grab. Inflation jumped to 20% a year ago and unemployment has risen too.
"So far a total of 31,102 ballot box results [in Istanbul] have been registered to the system, 84 ballot box results have not been concluded because of objections", he said.
The ruling party's loss of the capital Ankara, a symbol of political power, was also significant, said Soner Cagaptay, an expert on Turkey at the Washington Institute for Near East Policy. In an echo of the 2018 crisis, the currency has swung wildly in the last six trading days as the government and central bank unleashed a series of stop-gap support measures.
The opposition pro-Kurdish Peoples' Democratic Party (HDP) said the elections were unfair and refused to put forward candidates in several cities.
The government has replaced 95 elected officials since 2016 for alleged links to outlawed Kurdish militants.
"We have submitted all our appeals to the district electoral councils", Senocak said, as he waved ballot records in which he said vote count irregularities could be seen.