The War of the Confederation () was a military confrontation waged by the United Restoration Army, the alliance of the land and naval forces of Chile and the Restoration Army of Peru, formed in 1836 by Peruvian soldiers opposed to the confederation, and the Argentine Confederation against the Peru–Bolivian Confederation between 1836 and 1839. As a result of the Salaverry-Santa Cruz War, the Peru–Bolivian Confederation was created by General Andrés de Santa Cruz, which caused a power struggle in southern South America, with Chile and the Argentine Confederation, as both distrusted this new and powerful political entity, seeing their geopolitical interests threatened. After some incidents, Chile and the Argentine Confederation declared war on the Peru–Bolivian Confederation, although both waged war separately.

Chile since 1836 carried out the war with Peruvian dissidents who were enemies of Santa Cruz. During the war, one of Santa Cruz's subordinates, General Luis José de Orbegoso, rebelled against him in 1838 to restore Peru with a new government. However, by not allying with Chile, he ended up being defeated by Chilean forces. On the other hand, the Argentine Confederation did not achieve any significant advance between 1837 and 1838, paralyzing its war front and losing some territories north of Jujuy, notwithstanding the importance for the Rosas government of the war against Bolivia as an instrument of political cohesion at the level of the Argentine Confederation, Rosas had enemies and problems on many fronts, among which it is worth mentioning the intrigues of the unitary emigrants in the Banda Oriental (Uruguay) and Chile, and the problem posed to the commercial interests of Buenos Aires by the conflict with France, which would soon lead to the French blockade of the Río de la Plata. Due to the presence of these multiple conflicts, Rosas could not divert his attention or his resources in the war he had decided against Bolivia.Rosas se encamina hacia la guerra. Historia general de las Relaciones Exteriores de la República Argentina Finally, Chilean-Peruvian forces of the so-called Restorative Army led by General Manuel Bulnes, obtain a decisive victory in the battle of Yungay in 1839 while Andrés de Santa Cruz had been overthrown from the post of President of Bolivia by general José Miguel de Velasco who betrayed him before knowing the result of the battle. At the same time the general José Ballivián leaving the battlefield and mutinied in La Paz along with Bolivian reserve battalions. Also Colonel Guilarte, who had 700 soldiers in command, had abandoned his position and deserted without firing any shots.La segunda campaña restauradora. De guia a Yungay. La iniciación de la república, Jorge Basadre UNA APROXIMACIÓN HISTORIOGRÁFICA AL “CAUDILLO” ANDRÉS DE SANTA CRUZ, Pol Colàs This battle caused the dissolution of the Peru–Bolivian Confederation, the exile of Santa Cruz, the restoration of Peru and Bolivia, among other consequences.

Historians have proposed different long-lasting effects of the war including the consolidation of the ideas of Peruvian and Chilean nationality.

Background The creation in 1836 of the Peru–Bolivian Confederation by Marshal Andrés de Santa Cruz caused great alarm in the neighbouring countries. The potential power of this confederation aroused the opposition of Argentina and, above all, Chile, due not only to its size but also to the perceived threat that such a rich state signified for the area. Diego Portales, arguably the most important Chilean statesman of the 19th century, who at the time was the power behind president José Joaquín Prieto Vial, was very concerned that the new Confederacy would break the regional balance of power and even be a threat to Chilean independence, and so became immediately its enemy.

But that was just one of the reasons behind the war. On a deeper level, both countries were in a heated competition for the control of the commercial routes on the Pacific; and for the Chileans especially, whose relations with independent Peru had already been strained by economic problems centering on the rivalry between their ports of Callao and Valparaíso. For the North-Peruvian landowners also, the Confederacy was viewed as a most serious threat to their economic interests.

Tariff war The direct conflict between the two countries started with a simple tariff disagreement. In January 1835, Gen. Felipe Salaverry, by then president of Peru, signed a Treaty of Friendship, Commerce and Navigation with Chile. When President Salaverry was replaced by General Luis Orbegoso in Peru, the treaty was declared null and void on February 14, 1836. In the meantime, the Confederacy was already taking form. In order to force Chile to renegotiate, Peru raised its tariff on Chilean wheat from 12 cents to 3 pesos – an increase of 2,400%. Chile responded by raising the tariffs on Peruvian sugar by the same amount. The hostilities started to grow until the Mexican minister (ambassador) to Chile offered to mediate in the conflict. Open conflict was averted for the time being.

Freire Expedition After the victory of the conservative party in the Chilean Civil War of 1829–1830, former Chilean president General Ramón Freire y Serrano was exiled to Lima. He managed to obtain a small subsidy from the Confederate government to equip a frigate and try to wrestle power from the Prieto administration. The adventure was a quick failure. The sloop Orbegoso was captured by the frigate Monteagudo on July 28, 1836, and became part of the Chilean fleet. In the meantime, Freire who had managed to capture the city of Ancud was defeated and captured himself, being sent this time to the prison-island of Robinson Crusoe. Later he was exiled to Australia.

Escalation Raid on Callao

The Freire Expedition had a secondary result. Portales decided to take the offensive and staged a surprise raid to prevent further interference by the Confederate government in Chilean internal affairs. He gave command of the small Chilean fleet to the Spanish sailor Victorino Garrido and ordered him to raid the Confederate fleet that was stationed in the port of Callao. Garrido, who arrived with the brigantine Aquiles on a goodwill visit, staged a silent attack on the night of August 21, 1836, managing to capture 3 confederate ships: the Santa Cruz, Arequipeño and Peruviana.

Chilean declaration of war Instead of immediately going to war, Marshal Andrés de Santa Cruz tried to negotiate with Chile. The Chilean Congress sent Mariano Egaña as plenipotentiary to negotiate a treaty based on several points: the payments of the outstanding international debts owed by Peru to Chile, the limitation of the outstanding armies, commercial agreements, compensation to Chile for the Freire Expedition, and the dissolution of the Confederation. Santa Cruz agreed to everything but the dissolution. Chile responded by declaring war on December 28, 1836. The international situation was not favorable to the Chilean interests. Marshal Santa Cruz and the Confederation had been diplomatically recognized by the principal world powers with interests in the region (Great Britain, France and the United States), while the possible Chilean allies (Argentina and Ecuador) had decided to remain neutral in the conflict.

Argentine declaration of war Nonetheless, the involvement of Marshal Santa Cruz in Argentina's internal affairs by his continued support to the opponents of caudillo Juan Manuel de Rosas, moved this country to also declare war on May 9, 1837, in support of the northern province of Tucumán, which was threatened by Santa Cruz's forces. France supported Santa Cruz's war effort by imposing a naval blockade over Buenos Aires, an ill-fated attempt to remove Rosas from power. Also, France took advantage of the Uruguayan Civil War and the Argentine Civil Wars, supporting Fructuoso Rivera and Juan Lavalle against Manuel Oribe and Rosas.

In a letter that he sent to Governor Heredia on January 10, 1837, Rosas acknowledged that he was not in a position to confront General Santa Cruz:

Even though Chile and Argentina were acting against the same perceived threat, both countries went to war independently, due to the intense dislike between Portales and Rosas, and both countries continued to act separately throughout the whole course of the conflict. In 1837 Santa Cruz's forces defeated an Argentine army sent to topple him. If, as Rosas himself claimed, the forces of the Argentine Confederation were not in a position to sustain operations in the North against the Bolivian armies, why was Rosas determined to war against the government of Santa Cruz? The obvious answer is that the Governor of Buenos Aires calculated that the Chilean forces were far superior to those of Santa Cruz, and that the alliance with the Chilean government would destroy the nest of anti-riot conspirators that Bolivia had become. For Chile, the war against the Peruvian-Bolivian Confederation was decisive: commercial supremacy and the balance of power in the Pacific were discussed. For the Argentine Confederation, on the other hand, this war was more important for internal politics than economic and strategic. The economic damages suffered by the Rosas government because of Santa Cruz were relatively limited, the main one being the 40% tax on overseas merchandise brought into Bolivia from the Argentine provinces. These economic damages did not in themselves justify a war and in principle could be resolved peacefully. If Rosas finally decided in favor of the war, it was because of his implications against his internal enemies, and also because the eventual defeat of Santa Cruz would perhaps allow him to demand the restitution of the province of Tarija. But the latter concerned more the Northern provinces than Rosas himself and the Litoral provinces. Finally, and as a consequence of these considerations, Rosas resolved that it would be the northern provinces that, in defense of their immediate interests, would bear the brunt of the warlike actions.

Assassination of Portales The Chilean government, in order to bolster its sagging standing with public opinion (which was opposed to a war they did not understand), imposed martial law and asked for (and obtained) extraordinary legislative powers from Congress. Early in 1837 a Court Martial Law was approved and given jurisdiction over all citizens for the duration of the war. The opposition to the Prieto administration immediately accused Portales of tyranny, and started a heated press campaign against him personally and the unpopular war in general.

Political and public opposition to war immediately affected the army, fresh still from the purges of the civil war of 1829-1830. On June 4, 1837, Coronel José Antonio Vidaurre, commander of the "Maipo" regiment, captured and imprisoned Portales while he was reviewing troops at the army barracks in Quillota. Vidaurre immediately proceeded to attack Valparaíso on the mistaken belief that public opinion opposed to the war would support him and topple the government. Rear Admiral Manuel Blanco Encalada, in charge of the defense, defeated him right outside the port at the Battle of Baron. Captain Santiago Florín, who was in charge of Portales, had him shot when he heard of the news, on June 6, 1837. Most of the conspirators were subsequently captured and executed.

This murder, which was perceived as having been orchestrated by Marshal Santa Cruz, turned the tide of Chilean public opinion against the Confederation. The government later had martial law revoked nationwide and the country rallied behind the government. The war became a holy cause, and Portales its martyr.

First campaign Confederate naval campaign