Eleven years after the outbreak of the Mexican War of Independence, Spanish Viceroy Juan de O'Donojú signs the Treaty of Córdoba, which approves a plan to make Mexico an independent constitutional monarchy.
In the early 19th century, Napoleon's occupation of Spain led to the outbreak of revolts all across Spanish America. On September 16, 1810, Miguel Hidalgo y Costilla, a Catholic priest, launched the Mexican War of Independence with the issuing of his Grito de Dolores, or "Cry of Delores." The revolutionary tract called for the end of Spanish rule in Mexico, redistribution of land, and racial equality. After some initial successes, Hidalgo was defeated, captured, and executed. However, he was followed by other peasant leaders, such as José María Morelos y Pavón, Mariano Matamoros, and Vicente Guerrero, who all led armies of native and racially mixed revolutionaries against the Spanish and the Royalists.
Ironically, it was the Royalists–made up of Mexicans of Spanish descent and other conservatives–who ultimately brought about independence. In 1820, liberals took power in Spain, and the new government promised reforms to appease the Mexican revolutionaries. In response, Mexican conservatives called for independence as a means of maintaining their privileged position in Mexican society.
In early 1821, Agustín de Iturbide, the leader of the Royalist forces, negotiated the Plan of Iguala with Vicente Guerrero. Under the plan, Mexico would be established as an independent constitutional monarchy, the privileged position of the Catholic Church would be maintained, and Mexicans of Spanish descent would be regarded as equals to pure Spaniards. Mexicans of mixed or pure Indian blood would have lesser rights.
Iturbide defeated the Royalist forces still opposed to independence, and the new Spanish viceroy, lacking money, provisions, and troops, was forced to accept Mexican independence. On August 24, 1821, O'Donojú signed the Treaty of Córdoba, thus ending New Spain's dependence on Old Spain.
In 1822, as no Bourbon monarch to rule Mexico had been found, Iturbide was proclaimed the emperor of Mexico. However, his empire was short-lived, and in 1823 republican leaders Santa Anna and Guadalupe Victoria deposed Iturbide and set up a republic with Guadalupe Victoria as its first president.