Intermittent warfare continued until 1817. With Carrera in prison in Argentina, O'Higgins and anti-Carrera cohort José de San Martín, hero of the Argentine War of Independence, led an army that crossed the Andes into Chile and defeated the royalists. On 12 February 1818, Chile was proclaimed an independent republic. The political revolt brought little social change, however, and 19th-century Chilean society preserved the essence of the stratified colonial social structure, which was greatly influenced by family politics and the Roman Catholic Church. A strong presidency eventually emerged, but wealthy landowners remained powerful.