Turkish President Recep Tayyip Erdogan has suffered a shock defeat at the ballot box against the main opposition party, amid rampant inflation and the highest borrowing costs since he swept to power more than two decades ago.

Erdogan’s AK Party (AKP) fell behind the main opposition Republican People’s Party (CHP) in Sunday’s municipal elections for the first time ever, according to early results published by state broadcaster TRT.

Support for AKP stood at 35.9% while CHP was leading the race with 37.3%, with nearly 90% of the ballots counted, TRT reported.