On October 9, 1820, Olmedo and others declared the city of Guayaquil independent from Spain. He was President of the "Free Province of Guayaquil" until it was united to "Gran Colombia" by Simón Bolívar against Olmedo's will. He was also twice mayor of Guayaquil.