The opposition CHP party candidate for Istanbul mayor, Ekrem Imamoglu, was leading by almost 28,000 votes with most ballot boxes counted, Supreme Election Board (YSK) chairman Sadi Guven said.
"We will start our work to detect our shortcomings", Erdogan said in a speech.
The Turkish leader did not directly mention the full election results there or in Istanbul.
The AKP is trailing at 47.6 per cent votes, the report quoting a Turkey Supreme Election Council official said.
The Turkish national currency suffered losses Monday before recovering slightly after President Erdogan's AK Party saw election losses in big cities, including capital Ankara. Imamoglu said he had a lead of 28,000 with only 2,000 votes uncounted.
The ruling AKP won around 44.3 percent of the vote nationwide, but claims a majority under an electoral alliance with the Nationalist Movement Party (MHP).
The ruling party lost the capital Ankara and the race for Istanbul mayor was still too close to call early on Monday.
But after a failed military coup in 2016, tens of thousands of people - many of them his critics - were arrested and public institutions gutted.
Turkish President Tayyip Erdogan, accompanied by his wife Emine Erdogan, addresses AK Party supporters in Ankara, Turkey April 1, 2019. He had campaigned relentlessly ahead of the vote, describing it as a "matter of survival" for the country.
Turkish President Recep Tayyip Erdogan attends a press conference after the local elections in Istanbul.
Imamoglu's rise gives hope to a younger generation of politicians from the Republican People's Party (CHP), Turkey's secular party, as it challenges more than a decade and half of AKP in power.
Sadi Guven told reporters that the CHP's Ekrem Imamoglu had 4,159,650 votes and the AKP's Binali Yildirim had 4,131,761 votes. The CHP retained control of Turkey's third city Izmir by a comfortable margin. He may yet overturn the opposition's apparent win in Istanbul, or find ways to make life hard for the newly-elected mayors.
But his opponent Ekrem Imamoglu dismissed Yildirim's claim as an attempt to manipulate opinion and asked him to be responsible while the final tally was being completed. The private Demiroren news agency showed Imamoglu leading Monday. The Malatya governorate said four individuals were detained. Erdogan's own ascent to power began there in 1994.
Sunday's elections were a test for Erdogan in a nation rocked with economic turmoil.
Similarly, the AKP believes actions should be taken in Istanbul to make sure the vote unfolded regularly.
The CHP candidate obtained 4,169,987 votes, while the AKP stopped at 4,146,042.
Sunday's election was a significant victory for the opposition, which displayed good strategies and promising candidates, said Ozgur Unluhisarcikli, the Ankara director of the German Marshall Fund. "Had they not, this would lead into a questioning of their legitimacy".
"The difference continues to fall", Yavuz said in Istanbul, adding that the election in the city was the "most flawed in our democratic history". The Turkish lira tumbled more than 28 percent in value past year alone, with little sign of improvement, as inflation stands at 20 percent and unemployment over 10 percent.