Chile–Spain relations Captaincy General of Chile declared Chile as an autonomous republic within the Spanish monarchy. For the next decade, Chilean forces would battle Spanish troops for independence. In October 1814, Chilean troops lost during the Battle of Rancagua which led to the "Reconquista" of Chile by Spain from 1814-1817. In February 1817, troops led by General Bernardo O'Higgins, along with General José de San Martín and the "Army of the Andes" entered Chile from Argentina through the Andes and fought Spain in the Battle of Chacabuco which resulted in a Chilean/Argentine victory. In April 1818, O'Higgins and San Martín's forces fought
José Bernardo de Tagle y Portocarrero, Marquis of Torre Tagle member of the triumvirate under José de La Mar. In January 1823, the congress appointed him president, but a military mutiny deposed him and proclaimed José de la Riva Agüero president on 28 February. After the deposition of Riva Agüero and his retreat to Trujillo, Torre Tagle was appointed president by Antonio José de Sucre on 20 July, and elected by the congress on 16 August, and Bolivar, who on his arrival 1 September had been proclaimed dictator, left him in charge of the government. During his tenure, the Peruvian flag, which had been established by José de San Martín,