He previously served as a senator representing Mexico City from 2012 to 2018 during the LXII and LXIII Legislatures of the Mexican Congress, and then as a deputy representing the 13th federal electoral district for Mexico City during the LXIV Legislature of the Mexican Congress before resigning to become president of Morena.