On August 10, 1814, San Martin was appointed governor of Cuyo, and at once devoted himself to the development of the plans which led to the emancipation of half a continent and gave him his place in the world's history. The revolutionary movement in Chile had just been crushed out. It was begun in 1810 and the general course of events had been somewhat similar to the Argentine movement, but it had fallen a victim first to disputes between the Patriot leaders and finally to the troops of the viceroy of Peru. It would require more space than we can give to trace the varying fortunes of the cause in Chile through the stirring events that marked the leadership of Dr. Rosas, of the Carrera brothers, and of Bernardo O'Higgins. After the final collapse, O'Higgins, with a number of other Patriots, fled over the Andes to Mendoza and readily entered into the plans of San Martin. It took the latter two years to organize and equip an army and to convince the government of Buenos Aires of the practicability of his plan.
At length, on January 17, 1817, he began the passage of the Andes with about 5,000 men, 1,600 horses, and 9,000 mules, the latter carrying the field artillery, ammunition, and provisions. The summit of the Uspallata Pass is 12,700 feet above the sea-level, 5,000 feet higher than the Great St. Bernard, by which Napoleon led his army over the Alps. In many other respects San Martin's achievement was more remarkable. Each piece of artillery had to be carried suspended on a pole between two mules, or, where the road was particularly dangerous, dragged by ropes. There were chasms that could be crossed only by cable bridges. The march over the Andes occupied three weeks. Both men and animals suffered greatly from _soroche_, the illness caused by rarefied atmosphere.
At the foot of the mountain, at Chacabuco, the vanguard of San Martin's army defeated a body of 4,000 Royalists, and thus opened the road to Santiago, which San Martin entered February 14, 1817. The Chileans chose him Supreme Director of their government, but he declined the office, and O'Higgins was chosen.
San Martin's great object was to crush the colonial power of Spain in its stronghold, Peru. Having by the successful passage of the Andes and the victory of Chacabuco in a measure justified his plan of campaign, he returned to Buenos Aires for reinforcements. The Royalists meanwhile retreated to the south. On February 18, 1818, the independence of Chile was proclaimed. A month later the Patriots were surprised at Cancha-Rayada and almost routed, but within two weeks the army was again ready for action, and on April 5, 1818, encountered the Royalists at Maipo. This battle was a complete victory for the Patriots and decided the fate of Chile. Only one or two fortresses in the south were now held for Spain. Five days after the battle of Maipo, San Martin returned once more to Buenos Aires and began organizing an expedition for the liberation of Peru. Puyrredon, now Supreme Director, supported his undertaking.