In the Peruvian Army of Liberation Despite his promising career in the royal army, like many other American officers he defected to the pro-independence side, although a few days later he was already a member of the patriot army, fighting the rest of the campaign against the army in which he had served until then and in the that a brother of his was still training as an assistant to Brigadier Valdés, incorporated into the Peruvian army, he made the second intermediate campaign under the command of General
Andrés de Santa Cruz, finding himself in the
battle of Zepita for which Santa Cruz was appointed marshal. When General Santa Cruz withdrew in defeat from Upper Peru, he led a party of scattered soldiers who joined the army of the patriotic leader
José Miguel Lanza to fight under his orders in Alzuri against the forces of General
Olañeta where, despite their courage, they were defeated by the best equipped royalist troops, after this action he returned to Lima to join the united army of
Bolívar being named commander of the third squadron of Hussars of Junín who, due to their brave participation in the
Battle of Junín, in which Commander Soto was recognized for his courage in the official report, were renamed by the liberator as Hussars of Junín, and that today constitute the presidential guard of Peru. Finally, he would also fight in the decisive
Battle of Ayacucho in which he was seriously wounded to the point that, believing his death certain, he told General
José de la Mar, chief of his division, when he went to see him, the following: "General, I am dying, but I have the satisfaction of sealing my country's freedom with my blood." According to the memoirs of Colonel Manuel Antonio López, Commander Soto was among the more than 50 officers, mainly Peruvians, who, on the eve of the final battle, gathered in the field of Ayacucho to greet and say goodbye to his family and friends who were active in the royal army and in which his brother commanded a body of Spanish cavalry.
Upper Peruvian campaign His wound was duly treated and once he was healed he marched to
Upper Peru where Bolívar, separating Upper Peru from Lower Peru, had just created the Republic of Bolívar (now Bolivia), with the rank of General Pedro Blanco Soto entered the service of the Army of his native country. The government headed by Antonio José de Sucre maintained a large Colombian division in the country, which together with a Bolivarian government created discontent in a sector of the population and the Bolivian army. The same Colombian troops ended up revolting against the authority of Sucre, who was wounded trying to put down a mutiny in
Chuquisaca. Under this situation of internal commotion, the invasion of the Peruvian army under the command of
Agustín Gamarra took place, the objective of which was to force the departure of the Colombian troops from Bolivia given that they constituted a threat to Peru due to their rejection of the life presidency of Bolivar and problems bordering
Gran Colombia was at the gates of a war with that country. The division commanded by General Blanco declared in favor of the Peruvian army, on May 31 the one commanded by General
Braun attacked him in
Potosí but was repulsed. The bulk of the Bolivian army under the command of General
José María Pérez de Urdininea, greatly diminished by the defection of chiefs and soldiers to Gamarra's army, withdrew to Oruro without a battle. The Peruvian army then occupied the cities of La Paz and Oruro. Blanco's forces went to the city of Sucre and then to Ñuccho where they arrested President Antonio José de Sucre, although he was later released by Gamarra. On July 6, 1828, the Treaty of Piquiza was signed. In the treaty, the departure of the Gran Colombian troops through the port of Arica was agreed, in transport provided by the government of Peru, whose troops also withdrew in September of that year. == President of Bolivia ==