José de San Martín was born in 1778 at Yapeyú, a former Jesuit mission town in what is now northeastern Argentina, where his father was a Spanish official. The family returned to Spain when he was a child, and he entered the Spanish army at eleven. Over two decades he fought in North Africa, against revolutionary France and against Napoleon's invasion of Spain, rising to lieutenant colonel. In 1812, for reasons he never fully explained, he resigned his commission, sailed to Buenos Aires and offered his services to the revolutionary government there. He was a creole by birth who had spent most of his life in the service of the empire he now set out to dismantle.
San Martín grasped a strategic fact others had missed. Royalist power in South America rested on the Viceroyalty of Peru, and repeated attempts to attack it overland through the highlands of what is now Bolivia had failed. He proposed instead to cross the Andes into Chile and then go north by sea. As governor of the province of Cuyo he spent more than two years at Mendoza building the Army of the Andes, some five thousand men including many formerly enslaved soldiers who were promised freedom. In January and February 1817 he took this force, with its artillery and mules, over passes more than 3,000 meters high, a feat often compared to Hannibal's crossing of the Alps. He surprised the royalists at Chacabuco, entered Santiago, and with the Chilean leader Bernardo O'Higgins secured Chile's independence at Maipú in 1818.
In 1820 he sailed north with a fleet commanded by the British admiral Thomas Cochrane, occupied Lima and proclaimed Peru's independence on July 28, 1821, taking the title of Protector. But royalist armies still held the mountains, and his forces were too weak to dislodge them. In July 1822 he met Simón Bolívar at Guayaquil. No record of their private talks survives. Afterward San Martín resigned, left the completion of the war to Bolívar, and sailed for Europe, where he died in exile in France in 1850.
San Martín was a soldier rather than an ideologue. Doubting that inexperienced societies could sustain republics, he favored constitutional monarchies for the new states. His withdrawal from power contrasts with Bolívar's attempt to rule what he had freed and with the ambitions of the Caudillos who followed. Both men are central to the Latin American Wars of Independence.