Marshal Andrés de Santa Cruz, president of the republic of Bolivia since 1829, managed to stabilize and organize Bolivia as a great nation of the South American continent. His ambitious project was the reunification of Peru with Bolivia as it used to be at the time of Peruvian vice royalty or of Inca Tawantinsuyu.

Santa Cruz took advantage of a period of anarchy in Peru to conquer this country. He head an army of 5,000 soldiers to victory at Socabaya on February 7, 1836. On June 20, 1836, Peru and Bolivia became unified into a confederation, and the Peruvian territory was divided into two states (North and South).

The powerful confederation triggered hostilities with Argentina and Chile (which relationships with Peru were already tense), and also suffered an internal rebellion among the Peruvian population. The war was declared between the four neighbor countries on May 19, 1837.

On June 28, 1837, the Argentinean army was defeated by Marshal Santa Cruz in Humahuaca and withdrew from the conflict.

On January 20, 1839, during the battle of Yuncai, the Bolivian army was defeated by the Chilean army (lead by General Bulnes). This event put an end to the Peruvian-Bolivian confederation. Santa Cruz found refuge in Ecuador.

On July 12, 1839 the town of Chuquisaca was renamed Sucre.

The period that followed the Peruvian-Bolivian confederation was characterized by a political instability in Bolivia, one president replacing another in short periods of governance.