<P> After that, the mainland of New Spain was organized as the Mexican Empire . This ephemeral Catholic monarchy changed to a federal republic in 1823, due to internal conflicts and the separation of Central America from Mexico . </P> <P> After some Spanish reconquest attempts, including the expedition of Isidro Barradas in 1829, Spain under the rule of Isabella II recognized the independence of Mexico in 1836 . </P> <P> Mexican resistance and struggle for independence began with the brutal Spanish conquest of the Aztec Empire when Spanish conquerors had considerable autonomy from crown control . Don Martín Cortés (son of Hernán Cortés), the second marquis of the Valley of Oaxaca, led a conspiracy of holders of encomiendas against the Spanish crown after it sought to eliminate privileges for the conquistadors, particularly putting limitations on encomiendas . After the suppression of that mid-16th - century conspiracy, elites raised no substantial challenge to royal rule until the Hidalgo revolt of 1810 . </P> <P> Elites in Mexico City in the seventeenth century did force the removal of a reformist viceroy, the Marqués de Gelves, following an urban riot in 1624 fomented by those elites . He attempted to eliminate corrupt practices by creole elites as well as rein in the opulent displays of the clergy's power, but ecclesiastical authorities in conjunction with creole elites mobilized urban plebeians to oust the viceroy . The crowd was reported to shout, "Long live the King! Love live Christ! Death to bad government! Death to the heretic Lutheran (Viceroy Gelves)! Arrest the viceroy!" The attack was against Gelves as a bad representative of the crown and not against the monarchy or colonial rule itself . </P>

When did mexico's quest for independence begin