As President of Bolivia, Santa Cruz instigated several failed plots to achieve a political union with Peru, taking advantage of that country's chronic political 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.
Santa Cruz defeated Peruvian caudillo Agustín Gamarra at the Battle of Yanacocha (August 13, 1835) and Salaverry at the Battle of Uchumayo (February 4, 1836) after which he had Salaverry summarily executed.

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 (March 17, 1836).
A similar assembly at Huaura of the northern departments (Amazonas, Junín, La Libertad and Lima) founded the Republic of North Peru (August 11, 1836).
Both recognized Santa Cruz as Supreme Protector with extensive powers, which enabled him to create the Peru-Bolivian Confederation on October 28, 1836.
He summoned to the city of Tacna representatives of both legislatures together with those of the Bolivian Congress assembled at Tapacarí to establish a Constitution for the new State.
Under his direction, they signed a pact on May 1, 1837, which named him Supreme Protector for a ten-year period.

Invested with considerable powers, Santa Cruz endeavoured to establish in Peru the same type of authoritarian order he had imposed in Bolivia.
He issued a Civil Code, a Penal Code, a Trade Regulation, a Customs Regulation and reorganized tax collection procedures allowing an increase in state revenues while restraining expenditures.
 The Confederation generated resistances among several groups in both countries, who resented the dilution of national identities.
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.
Together they amassed a military expedition against Santa Cruz, led by Admiral Manuel Blanco Encalada, but they were encircled by Santa Cruz and had to surrender by the Treaty of Paucarpata, signed on November 17, 1837.
The Chilean Government organized a second expedition, which defeated the Supreme Protector at the Battle of Yungay (January 20, 1839) and forced the dissolution of the Confederation.
As President of Bolivia, Santa Cruz instigated several failed plots to achieve a political union with Peru, taking advantage of that country's chronic political 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. Santa Cruz defeated Peruvian caudillo Agustín Gamarra at the Battle of Yanacocha (August 13, 1835) and Salaverry at the Battle of Uchumayo (February 4, 1836) after which he had Salaverry summarily executed.
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 (March 17, 1836). A similar assembly at Huaura of the northern departments (Amazonas, Junín, La Libertad and Lima) founded the Republic of North Peru (August 11, 1836). Both recognized Santa Cruz as Supreme Protector with extensive powers, which enabled him to create the Peru-Bolivian Confederation on October 28, 1836. He summoned to the city of Tacna representatives of both legislatures together with those of the Bolivian Congress assembled at Tapacarí to establish a Constitution for the new State. Under his direction, they signed a pact on May 1, 1837, which named him Supreme Protector for a ten-year period.
Invested with considerable powers, Santa Cruz endeavoured to establish in Peru the same type of authoritarian order he had imposed in Bolivia. He issued a Civil Code, a Penal Code, a Trade Regulation, a Customs Regulation and reorganized tax collection procedures allowing an increase in state revenues while restraining expenditures.  The Confederation generated resistances among several groups in both countries, who resented the dilution of national identities. 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. Together they amassed a military expedition against Santa Cruz, led by Admiral Manuel Blanco Encalada, but they were encircled by Santa Cruz and had to surrender by the Treaty of Paucarpata, signed on November 17, 1837. The Chilean Government organized a second expedition, which defeated the Supreme Protector at the Battle of Yungay (January 20, 1839) and forced the dissolution of the Confederation.
Andrés de Santa Cruz