Mexican War of Independence
Although Mexico gained its independence in September 1821, the marking of this historical event did not take hold immediately. The choice of date to celebrate was problematic, because Iturbide, who achieved independence from Spain, was rapidly created Emperor of Mexico. His short-lived reign from 1821–22 ended when he was forced by the military to abdicate. This was a rocky start for the new nation, which made celebrating independence on the anniversary of Iturbide's Army of the Three Guarantees marching into Mexico City in triumph a less than perfect day for those who had opposed him. Celebrations of independence during his reign were marked on September 27. Following his ouster, there were calls to commemorate Mexican independence along the lines that the United States celebrated in grand style its Independence Day on July 4. The creation of a committee of powerful men to mark independence celebrations, the "Junta Patriótica", organized celebrations of both September 16, to commemorate Hidalgo's grito and the start of the independence insurgency, and September 27, to celebrate actual political independence.
Mexican–American War
Mexico obtained independence from Spain and the Spanish Empire with the Treaty of Córdoba in 1821. It briefly experimented with monarchy, but became a republic in 1824. This government was characterized by instability, leaving it ill-prepared for international conflict when war broke out only two decades later, in 1846. In the decades preceding the war, Native American raids in Mexico's sparsely settled north prompted the Mexican government to sponsor migration from the United States to the Mexican province of Texas to create a buffer. However, the newly named "Texians" revolted against the Mexican government of President/dictator Antonio López de Santa Anna, who had usurped the Mexican Constitution of 1824, in the subsequent 1836 Texas Revolution, creating a republic not recognized by Mexico, which still claimed it as part of its national territory. In 1845, the Texan Republic agreed to an offer of annexation by the U.S. Congress and became the 28th state in the Union on December 29 that year.