Mexicans of European descent officially in force through the rest of the colonial period. Criollo resentment of the privileges afforded to the "Peninsulares" was the main reason behind the Mexican War of Independence. When the war ended in 1821, the new Mexican government expelled the peninsulares (approximately 10,000 – 20,000 people) in the 1820s and 1830s which at a degree, kept the European ethnicity from growing as a percentage; this expulsion however, did not lead to any permanent ban on European immigrants, even from Spain. Independence did not do away with economic and social privilege based on race as the Criollos took over those
Mexican War of Independence rule until the Hidalgo revolt of 1810. 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!"