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 richest cities of Upper Peru, an open cabildo calls Goyeneche to withdraw from their territory, which he obeys as he did not have military strength to prevail. The Bishop of La Paz, Remigio La Santa y Ortega, flees with him. Castelli is received in Potosí, where he required an oath of allegiance to the Junta and the surrender of the royalist generals Francisco de Paula Sanz and José de Córdoba y Rojas. He arranged that the operation to capture Vicente Nieto was carried out exclusively by the surviving patricians at the mines of Potosi, who had been incorporated with honors