Ekrem Imamoglu, Mr. Erdogan’s primary opponent, was ahead in the Istanbul mayoral contest by ten percentage points with the majority of the ballots counted.
According to the state-run Anadolu Agency, the CHP took control of 36 out of Turkey’s 81 provinces, breaking into numerous strongholds held by Mr. Erdogan’s party.
In comparison to the president’s party, which received 36% of the votes overall, it received 37%.
In a statement from the presidential palace balcony, Mr. Erdogan, 70, recognized the electoral setback for him and his AK Party (AKP), claiming that his party had seen “a loss of altitude” throughout Turkey.
Opinion polls understated the performance of Mr. Erdogan and the AKP because of skyrocketing inflation, disgruntled Islamist supporters, and, in Istanbul, Mr. Imamoglu’s appeal outside the secular base of the CHP, according to observers.
At the end of Sunday night, hundreds of enthusiastic fans cheered Mr. Imamoglu’s speech, “Those who do not understand the nation’s message will eventually lose,” and some even started calling for Mr. Erdogan to step down.