Spanish attempts to reconquer Mexico
Mexican independence was officially achieved on September 27, 1821, under the Treaty of Córdoba. Spain did not recognize the treaties, arguing that the viceroy Juan O'Donojú had no authority to recognize the independence of any overseas province. This situation was dangerous to the newly acquired independent status of the nation, which had not yet been recognized by any of the European powers that could support it, and the threat of Spanish reconquest was a constant worry to the leaders of the nascent regime. On May 13, 1822 decrees were issued by the government to imprison anyone who conspired against Mexico's independence.
Military history of Mexico
The war for independence started on August 24, 1810, and was spearheaded by Miguel Hidalgo, a priest of Spanish descent and progressive ideas. After Napoleon I invaded Spain and put his brother on the Spanish throne, Mexican Conservatives and rich land-owners who supported Spain's Bourbon royal family objected to the comparatively more liberal Napoleonic policies. Thus an unlikely alliance was formed in Mexico: liberales, or Liberals, who favored a democratic Mexico, and conservadores, or Conservatives, who favored a Mexico ruled by a Bourbon monarch who would restore the old status quo. These two elements agreed only that Mexico must achieve independence and determine her own destiny.