Answer
Cochrane participated in the Liberating Expedition of Peru, a military campaign launched in 1817 to liberate Peru from Spanish colonial rule. Commanded by General José de San Martín, the expeditionary force, including Cochrane's naval squadron, played a crucial role in securing Peruvian independence. Cochrane's expertise in naval warfare and his daring tactics were instrumental in achieving victory against the Spanish forces.