In the 2019 local elections, the İYİ Party and HDP did not field mayoral candidates for Istanbul and Ankara metropolitan municipalities, paving the way for the CHP candidates, Ekrem İmamoğlu and Mansur Yavaş, to assume the mayorships against the ruling Justice and Development Party (AKP).
He received 54.22 percent of the votes against Binali Yıldırım from the AKP in the repeat vote. The Supreme Election Council (YSK) did not recognize İmamoğlu's initial victory in the 2019 local elections and ordered a repeat vote which the mayor again won.
İmamoğlu is one of the figures targeted frequently by Erdoğan and the ruling AKP ever since his decisive victory in the Istanbul elections in 2019. Infuriated by losing Turkey's largest city to the main opposition, the AKP has been making İmamoğlu face investigations on bogus charges.