Mexico Europeans. In 1521, the Spanish Empire conquered and colonized the territory from its politically powerful base in Mexico-Tenochtitlan (part of Mexico City), which was administered as the viceroyalty of New Spain. Three centuries later, the territory became a nation state following its recognition in 1821 after the colony's Mexican War of Independence. The post-independence period was tumultuous, characterized by economic inequality and many contrasting political changes. The Mexican–American War (1846–1848) led to a territorial cession of the extant northern territories to the United States. The Pastry War, the Franco-Mexican War, a civil war, two empires, and the Porfiriato occurred in
Decolonization of the Americas further wars were fought, such as the Paraguayan War and the War of the Pacific. A related process took place in what is now Mexico, Central America, and parts of North America between 1810 and 1821 with the Mexican War of Independence. Independence was achieved in 1821 by a coalition uniting under Agustín de Iturbide and the Army of the Three Guarantees. Unity was maintained for a short period under the First Mexican Empire, but within a decade the region fought against the United States over the border lands (losing bordering lands of California and Texas). Most of the heat