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
The Mexican Army emerged from the war of independence (1810–1821) as a weak and divided force. Before the war with the United States, the military faced both internal and foreign challenges. The Spanish still occupied the coastal fortress of San Juan de Ulúa, and Spain did not recognize Mexico's independence, so that the new nation was at risk for invasion. In 1829, the Spanish attempted to reconquer their former colony and Antonio López de Santa Anna became a national hero defending the homeland. The army had a set of privileges ("fueros"), established in the colonial era, that gave it jurisdiction over many aspects of its affairs. In general, the military supported conservative positions, advocating for a strong central government and upholding privileges of the military and the Catholic Church.