Mexico
Mexico emerged as an independent state from the Spanish viceroyalty of New Spain, with its capital at Mexico City. In 1810 the priest Miguel Hidalgo launched an uprising; after his execution, José María Morelos and then Vicente Guerrero continued the struggle.
In 1821 Guerrero joined the former royalist Agustín de Iturbide under the Plan of Iguala, and their army entered Mexico City. Iturbide became emperor in 1822, but conflict with Congress and an army revolt forced his abdication in 1823. A federal republic followed, and Spain recognized Mexican independence in 1836.