began the buildup of its Navy in order to carry the war to the Viceroyalty of Perú. Chile and Argentina signed a treaty in order to finance the enterprise. But Argentina, fallen in a Civil war, was unable to contribute. The naval fleet, after being built, launched a sea campaign to fight the Spanish fleet in the Pacific to liberate Peru. After a successful land and sea campaign, San Martín proclaimed the Independence of Peru in 1821. War against the Peru–Bolivian Confederation From 1836 to 1839, Chile and Argentina united in a war against the confederation of Peru and Bolivia. The underlying cause was the apprehension of Chile and Argentina against potential power of Peru-Bolivia block. This resulted from concern over the large territory of Peru-Bolivia as well as the perceived threat that such a rich state would represent to their southern neighbors. Chile declared the war on 11 November 1836 and Argentina on 19 May 1837. In 1837 Felipe Braun, one of Santa Cruz's most capable generals and highly decorated veteran of the war of independence, defeated an Argentine army sent to topple Santa Cruz. On 12 November 1838 Argentine representatives signed an agreement with the Bolivian troops. However, on 20 January 1839 the Chilean force obtained a decisive victory against Peru-Bolivia at the Battle of Yungay and the short-lived Peru-Bolivian Confederation came to an end. Chincha's war A series of coastal and high-seas naval battles between Spain and its former colonies of Peru and Chile occurred between 1864 and 1866. These actions began with Spain's seizure of the guano-rich Chincha Islands, part of a strategy by Isabel II of Spain to reassert her country's lost influence in Spain's former South American empire. These actions prompted an alliance between Ecuador, Bolivia, Peru and Chile against Spain. As a result, all Pacific coast ports of South America situated south of Colombia were closed to the Spanish fleet. Argentina, however, refused to join the alliance and maintained amicable relations with Spain and delivered coal to the Spanish fleet. War of the Pacific On 6 February 1873, Peru and Bolivia signed a secret Treaty of alliance against Chile. On 24 September, Argentine president Domingo Faustino Sarmiento asked the Argentine Chamber of Deputies to join Argentina with the alliance. The Argentine chamber assented by a vote of 48–18. The treaty made available a credit of six million pesos for military expenditures. However, in