The Expedición Libertadora del Perú (English: Liberating Expedition of Peru) was a force organized in 1820 by the Chilean government, with elements belonging to the Liberating Army of the Andes and the restored Army of Chile, that fought in the Peruvian War of Independence. On 5 February 1819, a treaty was signed between Chile and the United Provinces of the Rio de la Plata to finance and organize the expedition to Peru, but what would later become Chile, that had been recently liberated by the Argentine general Jose de San Martin, made the bulk of the effort to realize the expedition, since the United Provinces were distracted by internal conflicts and the direct threat of invasion from Spain. The expedition was the continuation of the plan of liberation that General José de San Martín conceived for the Spanish colonies on the South American pacific coast, with the support of General Bernardo O'Higgins in Chile. While the Chilean government headed by Bernardo O'Higgins played a pivotal role in organizing the expedition, the control of the Chilean Squadron was given to the British sailor Thomas Cochrane and the control of the Army was given to the Argentine General José de San Martín. The expedition liberated parts of Peru from Spanish Crown control. The complete liberation of Peru was achieved in 1824 with the intervention of Simón Bolívar.