After having overthrown Santa Cruz, the very president he once served under, in 1839, he began his third government (the longest of his four terms), during which he promulgated a new Political Constitution of the State which replaced the one drafted in 1835.
A career military officer, he first enlisted in the Spanish royalist army and served under the command of Brigadier José Manuel de Goyeneche.
[7] Within the newly established State of Upper Peru, he was appointed as the first prefect of Santa Cruz by Simón Bolívar on 11 November 1826, an office he assumed on 28 December.
[11] Ten days later, the Congress elected him to the post of provisional vice president and entrusted him with the command of the country pending the arrival of the president-designate Andrés de Santa Cruz.
[16] A month into his mandate, on 31 January 1829, Velasco dissolved the assembly by supreme decree, deeming it to have "exceeded the limits of [its] powers" and declaring the restoration of the regime which preceded it.
However, he eventually grew weary of Santa Cruz's ambitions, viewing him as having put Bolivia in the background in his quest to unify the state with Peru.
Following the defeat suffered by Santa Cruz in Yungay in January 1839, Velasco, at the command of a division formed from the 5th Battalion and the "Guías" Squadron, rose up in Tupiza and declared the secession of the Bolivian Republic from the Peru-Bolivian Confederation on 9 February.
[23] In the ensuing days, several pronouncements in support of the rebellion occurred, until on 17 February the government chaired by Vice President Calvo, who was in Cochabamba while Santa Cruz was absent in Arequipa, was deposed.
On its western frontier, military confrontation with the government of Peru, headed by President Gamarra, remained a looming threat towards the continued independence of Bolivia.
[28] In July 1839, Ballivián and the "Legión" battalion rebelled against the government, forcing Velasco to hand presidential command to the president of Congress, José Mariano Serrano, while he personally headed the army's response.
[30] The uprising ultimately resulted in failure, though Velasco commuted the death sentence of the rebellious 5th battalion and declared general amnesty to those involved in the Ballivián rebellion.
[28][31] Political conspiracies continued to transpire however, and on 10 June 1841, supporters of Santa Cruz revolted in Cochabamba and succeeded in imprisoning and exiling the president to Argentina.
[33] Meanwhile, Velasco, who had taken refuge in northern Argentina, reorganized his army into a fighting force of 1200 cavalry and rose up Tupiza, gaining the support of the capital in Sucre.
However, in a display of patriotic unity, Velasco opted to lay down his political aspirations and end his revolutionary movement and ceded control of his troops to Ballivián, who, with their help, obtained a resounding victory in the Battle of Ingavi on 18 November which resulted in the decisive defeat of the Peruvian army and the death of Gamarra.
[37] With the situation having spiralled out of control and seeing the writing on the wall, President Ballivián preemptively submitted his definitive resignation on 23 December in order to avoid his violent overthrow.
[41][42][43] Velasco and Belzu spent several months fighting in small skirmishes with alternating victories until 6 December when the president was finally defeated at Yamparaez.