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
History of Costa Rica Following the Mexican War of Independence (1810–1821), Costa Rica became part of the independent Mexican Empire in 1821. Subsequently, Costa Rica was part of the Federal Republic of Central America in 1823, before gaining full independence in 1838. Its economy struggled due to lack of connections with European suppliers. In 1856, Costa Rica resisted United States settlers from mounting a take-over of the government. After 1869, Costa Rica established a democratic government. After the Costa Rican Civil War in 1948, the government drafted a new constitution, guaranteeing universal suffrage and the dismantling of the military. Today, Costa Rica is a