On May 13, 1830, the day of Ecuador's breaking away from Gran Colombia, Flores was named supreme chief of the new country, and then on August 14, 1830, he was named provisional President. His official term, however, did not start until September 22, 1830, 11 days after he was elected constitutional President by the assembly in Riobamba. That term lasted until September 10, 1834, and was marked with much turmoil. Flores faced a rebellion led by Luis Urdaneta, a loyalist of Simón Bolívar, who wanted to prevent Ecuador from leaving Gran Colombia. Flores also faced a threat from a member of the Ecuadorian congress, Vicente Rocafuerte, who attempted to overthrow him. Eventually, the two made an agreement – Rocafuerte would become President after Flores, and Flores would become leader of the military. Also during his term, he fought an invading Colombian army in 1832 and again starting in 1834, finally defeating them on January 18, 1835 in Miñarica, near Ambato.