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
Trujillo, Peru only stable and productive area that could organize and lead the nascent republic. The department encompassed nearly half the country. For the efforts of its people in the war of emancipation, San Martín gave it the title of "Meritorious City Loyal to the Homeland". The municipality of the city, then called a "cabildo", was given the rank of "honorable". In 1823, after the creation of the Republic of Peru, the protectorate of José de San Martín was developed. Before royal troops took the city of Lima, the first President of Peru, Don José de la Riva Agüero, together with Sánchez