Mexican–American War 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
Declaration of Independence of the Mexican Empire of the Nation in Mexico City. The document is wide and high. On September 27, 1821, eleven years and eleven days after the Grito de Dolores, the Army of the Three Guarantees headed by Agustín de Iturbide entered Mexico City, concluding the Mexican War of Independence. On September 28, Iturbide installed the Provisional Governing Board, comprising 38 people. The board was chaired by Antonio Pérez Martínez y Robles, and Juan José Espinosa de los Monteros was secretary. The board immediately elected the five members of the Regency of the Empire. On October 13 of the same year, Ramón Gutiérrez del