The war between the Patriots in Argentina and the Royalists in Upper Peru (Bolivia) had been going on for 6 years.
In early November 1816, the Royalists invaded Argentina, advancing with 3,000 men under the command of Pedro Antonio de Olañeta, Juan Guillermo de Marquieguy, and Field Marshal José de la Serna.
They gained a victory at the Battle of Yavi on 15 November 1816.[1] At the beginning of 1817, José de la Serna continued his advance on Jujuy with 5,000 men and on 17 January, the vanguard commanded by Pedro Antonio Olañeta occupied San Salvador de Jujuy and waited for de la Serna to arrive with the bulk of the army. But their advance towards the south was harassed and detained by guerrilla groups commanded by Colonel Martín Miguel de Güemes. To make matters worst, de la Serna learned that José de San Martín and his Army of the Andes had crossed the Andes into Chile and defeated the royalist army there on 12 February. This left the Viceroyalty of Peru exposed to an invasion from Chile, so he had no choice but to withdraw.[2]
This division managed to gain a victory at the Battle of la Tablada de Tolomosa (15 April) and advance as far as Chuquisaca.
But there the Patriot division was repelled and defeated at the Battle of Sopachuy (12 June) and was forced to retreat to Tucuman, pursued by three royalist divisions.[4]
Nevertheless, the objective was achieved to turn back the Royalist invasion of 1816–17.
Results
This was the fourth and last time that the Northern Army had tried to advance into Upper Peru, and again the campaign had ended in failure. The next years, Argentina descended into civil war and Upper Peru would remain under Royalist control until 1825, after the Battle of Ayacucho, won by Patriot troops from Colombia and Peru.
García Camba, Andrés (1846). Memorias para la historia de las armas españolas en el Perú. Tomo I. Madrid (España): Sociedad tipográfica de Hortelano y compañía