Peru had invaded Bolivia in early 1828, refusing to recognize the republic as a sovereign state Upper Peru and Colombia's influence on it
On June 3, 1828 war broke out between the Republic of Peru and Gran Colombia. During this conflict, Peru moved into the "Department of the South" in Colombia, to near the city of Cuenca getting some naval victories while living in New Granada is a state of civil war and the revolt of the generals José María Obando and José Hilario López. After being pacified by Bolivar and reorganized the forces, the Colombian army launched a ground offensive that culminated in the Battle of Portete Tarqui the February 27, 1829, with the victory of the Colombian troops of Marshal Antonio Jose de Sucre, who beat an army superior in number. On February 28, 1830 signed the Treaty of Pigs, for the sake of a diplomatic solution.