 Estanislao López immobilized the army directed from Córdoba by Juan Bautista Bustos and captured Viamonte at Rosario, forcing him to sign the armistice of Santo Tomé.He was exiled to Montevideo after the Battle of Cepeda (1820), but he returned a year later in 1821 and was named governor of Buenos Aires Province due to the absence of Martín Rodríguez.He was a deputy to the General Congress of 1824 and he supported the unitarian constitution of 1826, but later on he changed sides and joined Dorrego's Federal Party.