After Santa Cruz's return home, his father enrolled him as an alférez in the "Dragones de Apolobamba" Regiment of the Spanish Army. As such, he participated in the battles of Guaqui (20 July 1811), Vilcapugio (1 October 1813) and Ayohuma (14 November 1813). The latter resulted in the defeat of the Argentine Independentist forces attempting to liberate the Upper Peru (modern day Bolivia) from Spanish rule. Santa Cruz also took part in the Spanish colonial campaigns to suppress the insurrection of Mateo Pumacahua (1814–15), further demonstrating his loyalty to the Spanish Crown. His luck ran out at the Battle of La Tablada (15 April 1817), where he was captured and taken as prisoner of war to Buenos Aires. He managed to escape, first to Rio de Janeiro and then to Lima. As a reward, he was named Commander of Chorrillos.