The Spanish American wars of independence were the wars of 1810-1826 by which Spain's American colonies threw off Spanish rule. In 1808 Napoleon imprisoned the Spanish king and set his brother Joseph on the throne; the metropole's authority dissolved, and the colonies rose to self-rule 'in the name of Ferdinand VII'. In September 1810 the priest Hidalgo's 'Grito de Dolores' opened the Mexican movement, and in the same year the town councils of Caracas and Buenos Aires took over government. The southern front advanced on two axes — Bolívar from the north freeing New Granada and Venezuela, San Martín from Argentina crossing the Andes to free Chile (Maipú, 1818) and taking Lima by sea (1821); after their Guayaquil meeting of 1822 San Martín withdrew. In December 1824 Sucre's victory at Ayacucho annihilated the Spanish main force in Peru; with the surrender of the Callao fort in January 1826 the three-hundred-year Spanish dominion on the mainland ended. Mexico had gone independent in 1821 on Iturbide's Three Guarantees, and Brazil separated peacefully as an empire in 1822. Independence begat more than nine new states — yet the caudillos, regional warlords and the old social structure of great estates, slavery and dependent natives ran on much as before; independence brought no social revolution, and the Monroe Doctrine of 1823 and British trade entered with the new flags: modern Latin America begins here.