With 44.2 percent of the votes counted as of 8pm (17:00 GMT), an AK Party-led alliance had secured 52.3 percent of the votes countrywide, according to state-run Anadolu Agency.
It was followed by a coalition led by the main opposition centre-left Republican People’s Party, with 37.8 of the votes.
The polls were seen as a major challenge for Erdogan and his party given a backdrop of high inflation and rising unemployment sparked by a major currency crisis last year.
The AK Party entered the race with its ally in the last two polls, the far-right Nationalist Movement Party (MHP), under the People’s Alliance. For its part, CHP joined forces with the right-wing Good (IYI) Party in the Nation Alliance.
Both blocs have fielded dozens of joint candidates in the country’s provinces, districts and towns.
With 74 percent of the votes counted In Istanbul, the country’s largest city and economic centre, Binali Yildirim, the candidate of Erdogan’s People’s Alliance and a former prime minister, was in the lead with 50.5 percent of the votes.
Ekrem Imamoglu, the Nation Alliance candidate, had 47 percent.
In the capital, Ankara, preliminary results showed that the Nation Alliance’s Mansur Yavas had garnered 58.3 percent, followed by People’s Alliance nominee Mehmet Ozhaseki, with 37.8 percent. Fifty-three percent of the votes have been counted.
In the third largest city, Izmir, the Nation Alliance candidate Mustafa Tunc Soyer was in the lead with 58 percent of the votes. Nihat Zeybekci, the candidate of Erdogan’s bloc, had 37 percent. Forty-three of the votes have been counted.
The polls took place against the backdrop of last year’s currency crisis and just weeks after official statistics showed that in the last two quarters of 2018 the Turkish economy slipped into its first recession in a decade, as inflation and interest rates soared due to the currency meltdown.
In February, inflation stood at just under 20 percent, while the Central Bank’s main interest rate is currently 24 percent.
As part of an initiative to tackle rising inflation, Turkey’s government set up these discounted food stalls. pic.twitter.com/5zAIy2LvGC
— Al Jazeera English (@AJEnglish) March 30, 2019
In the lead-up to Sunday’s vote, the People’s Alliance sought to link the local polls to internal and external risks threatening the country’s security.
Erdogan has often blamed foreign powers and “speculators” for the currency fluctuations and other economic woes faced by Turkey – a message he repeated this week.
For its part, the main opposition alliance has focused its campaign on the economic situation and its effect on citizens.
It also used Turkish flags in their campaigns, rather than party banners, in an apparent bid to attract voters from different backgrounds.
Ayse Kara, a 40-year-old voter in Istanbul, said she cast her ballot taking into account the stability of the country.
“I considered the economy and terror as the main issues while casting my vote. I believe everything will get more stable after the elections,” Kara, who works in manufacturing, told Al Jazeera.
Ilke Beltinge, a 25 year-old student, said she did not like the country’s current direction.
“I cast my vote for more freedoms, a better economy and a better educational system. And I hope that we will see change following these polls,” she told Al Jazeera at an Istanbul polling station.
Two people were killed in the eastern province of Malatya, and dozens of others were wounded in various provinces of Turkey in fights broke out in the voting process, state media reported.