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.
[29] 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.
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.
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.
Portales decided to take the offensive and staged a surprise raid to prevent further interference by the Confederate government in Chilean internal affairs.
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.
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.
France supported Santa Cruz's war effort by imposing a naval blockade over Buenos Aires, an ill-fated attempt to remove Rosas from power.
Governor of the province of Tucumán as protector of those of Salta, Jujuy and Catamarca, is the one who must take the direction, agreeing with the respective Governors of the said Provinces, since the undersigned placed at an immense distance from them, without practical knowledge of the territory in which it must operate, nor the elements of action it can count on to make President Santa Cruz enter into his duty, is not in a position to present an operations plan, without exposing himself to making major mistakes.
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.
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.
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.
[29] 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.
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.
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.
In September 1837 it sent a fleet carrying a Chilean expeditionary force of approximately 2,800 troops under the command of Admiral Manuel Blanco Encalada.
Surrounded and out-manoeuvered, and following an encounter at Paucarpata with an army under the command of Santa Cruz, Admiral Blanco Encalada was forced to sign a peace treaty.
Admiral Blanco Encalada as was thrown into jail and tried for high treason, together with his advisor Antonio José de Irisarri, who had refused to even return to Chile.
The Chilean force occupied Lima at the end of October, 1838 but abandoned it on November 3 on hearing of the approach of a large Bolivian army under General Santa Cruz.
Nonetheless, the resounding defeat of the Confederate fleet at Casma by the smaller Chilean squadron left Chile in absolute control of the southeastern Pacific.
Meanwhile, Santa Cruz failed to exploit the Chilean retreat fully, despite successes in several small skirmishes culminating in the first direct encounter between the bulk of both armies around the bridge of Buin on January 6, 1839.
After Buin, Santa Cruz was trying to finish off the Chilean Expedition in order to stabilize the internal situation in the country and to avoid any more uprisings against him.
In this battle, the Confederates, under the command of Marshal Santa Cruz, waited for Bulnes' offensive well defended on the Pan de Azúcar and Punyán hills, near the town of Yungay, and the rest were deployed over the Ancash River bank.
After the defeat of the Confederate army at Yungay on January 20, the Chileans commenced a second push southward, occupying Lima for the second time in April.
[citation needed] The Chilean troops left on October 19, 1839, after having achieved the goal of dissolving the Confederation and affirmed General Gamarra as President of Peru.