In 1816 he returned to Lima and Francisco Marcó del Pont was made new Governor of Chile. When the Spaniards lost the Battle of Chacabuco, he returned to Chile. There he succeeded in securing victory in the Second Battle of Cancha Rayada on March 18, 1818. At this battle O'Higgins's arm was injured.