At the time of the landing of the rebel army of José de San Martín on the Peruvian coast, Santa Cruz was commander of militia forces in the region of Huarochirí.
Santa Cruz ascended rapidly, reaching the rank of Colonel later that year and that of Brigade General in 1822 for leading Peruvian troops at the Battle of Pichincha (24 May 1822).
When Simón Bolívar assumed the presidency of Peru (17 February 1824), Santa Cruz joined his army and was named Chief of Staff of the Peruvian Division.
Named President of the Government Council in Lima, he was in charge of the Peruvian Executive after Bolívar returned to Gran Colombia on 4 September 1826, until the collapse of the Bolivarian regime in Peru on January 27, 1827.
The authoritarian regime imposed by Santa Cruz brought stability to Bolivia at a time when most countries in Latin America faced widespread unrest.
His best opportunity came in 1835 when the Peruvian President Luis José de Orbegoso requested his assistance to fight the rebel army of Felipe Santiago Salaverry.
At the instigation of Santa Cruz, a Congress of the Peruvian southern departments (Arequipa, Ayacucho, Cuzco and Puno) gathered at Sicuani and declared the establishment of the Republic of South Peru (17 March 1836).
A similar assembly at Huaura of the northern departments (Amazonas, Junín, La Libertad and Lima) founded the Republic of North Peru (11 August 1836).
An important number of Peruvian politicians opposed to the idea of the Confederation fled to Chile, where they received support from the powerful Minister Diego Portales.
One hundred years later, in 1965, the remains of the old Marshal were repatriated from France by the military government of the day and reinterred ceremoniously at Cathedral Basilica of Our Lady of Peace, La Paz beside the Presidential Palace in Bolivia.