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. In that condition, he participated of the Battle of Junín (6 August 1824). Afterwards, he was named Prefect of Ayacucho, and then Chief of Staff of the Patriot Army during the campaign for the liberation of Bolivia. As a reward for his actions, Santa Cruz received the titles of Marshal and Prefect of Chuquisaca in April 1825.