First, a clarification: Mexico City does not have a "president." As the nation's capital and a federal entity (since 2016), its executive head is the Head of Government (Jefe de Gobierno), commonly referred to as the Mayor.
| Mayor | Term | Party | Years |
|---|---|---|---|
| Cuauhtémoc Cárdenas | 1997–1999 | PRD | 2 (resigned for presidential run) |
| Rosario Robles | 1999–2000 | PRD | 1 (interim) |
| Andrés Manuel López Obrador | 2000–2005 | PRD | 5 (resigned for presidential run) |
| Alejandro Encinas | 2005–2006 | PRD | 1 (interim) |
| Marcelo Ebrard | 2006–2012 | PRD | 6 |
| Miguel Ángel Mancera | 2012–2018 | PRD/Morena | 6 |
| Claudia Sheinbaum | 2018–2023 | Morena | 5 (resigned for presidential run) |
| Martí Batres | 2023–present | Morena | Interim |