Chile–Peru relations forces as the Confederate forces began to split on opinions and the commanding skills of Manuel Bulnes Prieto proved superior to Santa Cruz, who was killed during the battle. Following this, Peru was once again unified, and Agustin Gamarra attempted to lead an invasion to Bolivia. The attack utterly failed, Gamarra was killed, and Peru and Bolivia entered into another war. Bolivia would once again invade Peru but, without Gamarra, Ramon Castilla became the most prominent military figure of Peru and troops were soon dispatched for the defensive. The success in this defense resulted in Peruvian victories that returned both
First Upper Peru campaign authorities. The May Revolution, in Buenos Aires, was more successful, and ousted the viceroy Baltasar Hidalgo de Cisneros. The Primera Junta, which replaced him, prepared a military expedition to Upper Peru to secure the control of the area, while another expedition headed to Paraguay. Before proceeding to Upper Peru, this military campaign defeated a counter revolution in Córdoba, organized by the former viceroy Santiago de Liniers. Ortiz de Ocampo disobeyed orders to execute the prisoners, sending them to Buenos Aires instead. As a result, the Junta appointed Juan José Castelli as commander of the Army of the North instead of