Viceroyalty of Peru itself was independent from Spain. Thus, a fleet and army was prepared for an expedition to the country, and in 1820, San Martín and Cochrane set off for Peru. However, the audacious and daring character of Cochrane conflicted with the excessive prudence of San Martín. San Martín let escape a number of opportunities to land the decisive blow against the viceroy, and in the end it was Simón Bolívar who launched the final offensive after coming down from Colombia, Peruvian independence was secured after the Battle of Ayacucho on December 9, 1824, in which forces led by Antonio José de Sucre—a lieutenant of Bolívar—defeated the royalist army for good. In Chilean historiography, the Patria Nueva generally ends in 1823, with the resignation of O'Higgins. However, the last Spanish territory in Chile, the archipelago of Chiloé, was not conquered until 1826, during the government of Ramón Freire, O'Higgins' successor. Economic impact The independence wars in Chile (1810–1818) and Peru (1809–1824) had a negative impact on the Chilean wheat industry. Trade was disrupted and armies in Chile pillaged the countryside. The Guerra a muerte phase was particularly destructive and ended only to see a period of outlaw banditry (e.g. Pincheira brothers) occur until the late 1820s. Trade with Peru did not fully recover after the independence struggles. Being isolated from Central Chile by hostile Mapuche-controlled territory and dependent upon seaborne trade with the port of Callao in Peru the city of Valdivia was particularly badly hit by the decline of the trade with Peru. The fortune of this city would not shift until the arrival of German settlers in the late 1840s. Much of the war effort was financed with silver from Agua Amarga, a mining area south of Vallenar discovered in 1811. Chile adopted a free trade policy already in 1811 with the "Decreto de Libre Comercio". This allowed the country in the mid-19th century to exploit the opportunities that the California Gold Rush and the Australian gold rushes created for exporting wheat. In 1822 Bernardo O'Higgins government obtained a large loan in London to finance the independence struggle. The resulting Chilean independence debt took decades to regularize, ending the default in 1840s thanks to the efforts of the Ministers of Finance Manuel Rengifo and Joaquín Tocornal plus the favourable international markers for Chilean silver, copper and wheat. See also References Further reading Harvey, Robert. "Liberators: Latin America`s