Gran Colombia–Peru War was the kernel of Bolívar's grander scheme to unite the former Spanish colonies in Central and South America. Prior to becoming the titular head of Gran Colombia, Bolívar had been, briefly, the president of the newly independent state of Bolivia, his namesake. Bolivia had formerly been a part of the Viceroyalty of the "Rio de La Plata", known as Upper Peru, and, once Bolívar relinquished the presidency of Bolivia to his revolutionary compatriot, Antonio José de Sucre Alcalá, in 1826, the Peruvians saw an opportunity. Early in 1828, Peru launched a campaign against Bolivia to reclaim its former territory and
First Upper Peru campaign of Córdoba, which was already executed for his support to Liniers. This mail mentioned a royalist army led by Goyeneche advancing over Jujuy. Balcarce, who had advanced to Potosi, was defeated by Nieto in the Battle of Cotagaita, so Castelli sent two hundred men and two cannons to strengthen his forces. With these reinforcements Balcarce achieved the victory at the Battle of Suipacha, which allowed patriots to control all of Upper Peru unopposed. One of the men sent was Martín Miguel de Güemes, who would eventually lead the "Guerra Gaucha" in Salta years later. At Villa Imperial, one of the