In 1816 he was transferred to Mendoza, where he joined the Army of the Andes, crossing to Chile under General José de San Martín in the column of Mariano Necochea, whose escort was a part. Under the command of Necochea, he participated in the combat of bribery. He fought in the Battle of Chacabuco (12 February 1817), earning a promotion to captain which was conferred on 27 February. He left Buenos Aires to bring trophies in Chacabuco, the Supreme Director Pueyrredón promoted him to sergeant major on 10 March. Back in Chile, he participated in the battles of Curapaligue, Talcahuano, Cancharayada and Maipú. He led the second campaign in southern Chile during 1818 and 1819.