After José de San Martín had abandoned Peru in September 1822, command of the United Peruvian army fell to General
Rudecindo Alvarado, under whose command the United army was ordered to defeat the bulk of the Royalist troops that were still intact in the south and the country's mountains. The first goal was to take the remaining ports under Spanish control, intermediate between
Arequipa and
Tarapacá. Therefore this expedition was called the
First Intermediate Campaign. In the first days of October, Alvarado's expedition, composed of approximately 4,300 troops and 10 pieces of artillery, sailed from
Callao and on 6 December, it landed in
Arica. Spanish Viceroy
José de la Serna, located in
Cusco, ordered Brigadier
Gerónimo Valdés to immediately march to
Arequipa to take command of the troops stationed there, and attack the army of Alvarado. Both armies met at Torata and the battle ended in a defeat for the Patriots, mainly because of dissensions between the officers and a lack of discipline amongst the troops. ==References==