
Beginning in 1521, following the defeat of the Aztecs, the Spanish began to colonize what is now Mexico. The Viceroyalty of New Spain, consisting of everything from modern-day Panama up through northern California, was a vast territory. Following successful revolutions in North America and France, common people in New Spain and its southern neighbors, the Viceroyalties of New Granada (today northern South America), Peru, and Rio de la Plata (present-day Argentina), wanted their own independence. When France seized control of Spain during the Peninsular War, revolutionaries in Spain’s colonies saw their chance to act. Over the course of a decade, revolutionaries in Mexico fought for freedom. The subsequent Mexican War of Independence began on September 16, 1810.
Establishing New Spain in the Americas

After “discovering” the New World in 1492 and settling the Caribbean in the early 1500s, Spanish explorers landed in modern-day Mexico in 1519. Though unsure what to think of the new arrivals, Moctezuma ultimately invited the Spanish into the Aztec capital, Tenochtitlan, where they began their efforts to dismantle the Aztec Empire.
The defeat of the Aztecs was swift, with the 500 or so Spanish soldiers aided by other Native American tribes and deadly smallpox. Smallpox ended up decimating the Native American population due in large part to their lack of natural immunity, allowing the Spanish to colonize almost the entirety of South and Central America. With the approval of both the Holy Roman Empire and the Roman Catholic Church, Spain formally established the Viceroyalty of New Spain, centered around the former Aztec capital of Tenochtitlan, in 1535.
Slavery and the Caste System in New Spain

After conquering the territory that would become New Spain, the Spanish created an elaborate system of social classes, race-based castes, and forced labor. The encomienda system used Native Americans for forced labor during the early 1500s, although this was protested by Spanish priest Bartolomé de las Casas and rendered illegal by King Charles V in 1542. However, protests by encomenderos (Spanish landowners in New Spain) led the king to revoke the law in 1545, allowing the enslavement of Indigenous people to continue.
By 1545, smallpox had killed many Native Americans, prompting the Spanish to transport slaves from Africa to the Caribbean and New Spain for labor. Therefore, the encomienda system was effectively replaced by African slavery. Over time, Spaniards intermarried with Native Americans, as did enslaved people from Africa. This created new demographic groups, which the Spanish placed into a hierarchical caste system. At the top of this hierarchy were full-blooded Spaniards who were born in Spain, known as peninsulares. At the bottom were the enslaved Africans, as Native Americans, though for all intents and purposes also enslaved, were technically considered Spanish subjects.
Shifting Demographics and the Growing Mestizo Population

Over time, the culture of New Spain became distinct from Spain itself. Many Spaniards intermarried with Native Americans, which produced the mestizo caste, quickly becoming the most rapidly growing demographic in the colony. Although they adopted Spanish surnames, as almost all fathers of mixed-race children were Spaniards, they maintained at least some cultural traditions from their mothers’ lineage. As New Spain grew and expanded, mestizos began filling important roles, including in government. However, they were often treated as second-class citizens, especially in areas with larger Spanish populations.
The increasing mestizo population, along with a growing African slave and mulatto (mixed African and Spanish lineage) population, created an increasing divide between Spain and New Spain. This was especially true outside of Mexico City (formerly Tenochtitlan), where the Spanish tended to congregate, and mestizos and mulattos had greater social and economic opportunities as New Spain’s infrastructure expanded northward into the present-day American Southwest. Over 300 years, the growing mixed-race population of New Spain weakened socio-cultural ties with Spain.
Isolation and Building Resentment among Criollos

The second tier of the caste system in New Spain consisted of criollos, those of pure Spanish descent born in the colonies. Although they were of Spanish heritage, they were considered less noble than peninsulares. Quickly, resentments built between the two castes, with peninsulares often believing criollos to be inferior and criollos believing peninsulares to be opportunistic snobs seeking unearned land and titles in the colonies. Over time, however, criollos began to gain more power and wealth due to their status as merchants. Commerce overtook crown-given land grants as the ultimate source of wealth and prestige during the 1700s.
After the mid-1700s, the formal caste system loosened, and criollos increasingly sought wealth and prestige internally, from within New Spain rather than from Spain itself. By the 1790s, the Spanish had relaxed many of the formal caste identifications for military service. Part of this was by necessity, as peninsulares and wealthier criollos had little desire for military service. This allowed less wealthy criollos and even some mestizos to use military service to gain prestige and noble titles.
Sparking Chaos: Napoleon Seizes Spain

Part of Spain’s relaxation of the formal caste system in its viceroyalties was out of necessity: it was no longer the same world power that had rapidly colonized South and Central America. After it failed to conquer England in 1588 with its massive Spanish Armada, Spain slowly ceded global power and prestige to France and England as they colonized North America. After the French and Indian War (1754-63), England was clearly the dominant power in Europe. Spain and France maintained an on-and-off alliance to try to check England’s power, which allowed France to surprise Spain with a sudden betrayal and seizure in 1807.
After the French Revolution (1789-94), military officer Napoleon Bonaparte emerged as the nation’s ruler after a 1799 coup d’état. Within a few years, he embarked on a mission to conquer all of Europe, a goal opposed most strongly by England. After 1804, Napoleon decided to invade Portugal after the small country defied France and continued to trade with England. Crafting a secret treaty with Spain that would divide Portugal between the two after its defeat, France sent its troops through Spain to invade Portugal by land. Then, in a surprise twist, Napoleon seized Spain and eventually placed his brother, Joseph Bonaparte, on the Spanish throne.

Although Napoleon was able to quickly depose King Carlos IV of Spain in early 1808, there was strong Spanish resistance. A revolt commenced, and Napoleon’s forces under General Dupont were handed one of their first military defeats in July 1808. The British quickly arrived in both Portugal and Spain to fight the French, resulting in a lengthy war. Napoleon responded by sending large armies to try to crush the “rebellion” in Spain and defeat the British, resulting in a historic feud between Napoleon and Britain’s Field Marshal Arthur Wellesley, later named Duke of Wellington.
With Spain completely embroiled in a European war, those in the viceroyalties of New Spain, New Granada, Peru, and Rio de la Plata who wanted independence had a prime opportunity. Inspired by recent successful revolutions in the United States and France, they desired self-rule and freedom from a rigid and oppressive monarchy. On September 16, 1810, a priest named Miguel Hidalgo y Costilla issued a call for independence. This date is today memorialized as Mexico’s Independence Day, when the Mexican War of Independence began. Similar independence movements began around the same time in South America, also taking advantage of Spain’s preoccupation with Napoleon’s forces.
Father Miguel Hidalgo Ignites an Unstoppable Popular Revolt

In the two years preceding Father Hidalgo’s declaration of independence, there had been division and distrust between criollos and peninsulares in New Spain regarding who should rule while Spain was effectively isolated by war. However, once the Mexican War of Independence began, criollos and peninsulares unified and became a powerful loyalist force. A new viceroy turned the tide on Hidalgo’s forces, which were mainly composed of Native Americans. The rebels fled north, away from Mexico City and toward the less-populated provinces.
In northern Mexico, government forces began to defect and ally with the rebels. However, this populist defection movement was short-lived, and within months the loyalists had regrouped. In March 1811, Father Hidalgo was captured and later executed. By August 1813, loyalists had regained control of even far-flung Texas, effectively defeating the first part of the Mexican War of Independence. Hidalgo’s successor, José María Morelos, formally declared independence from Spain and advocated democracy and an end to racial divisions. He was captured in 1815 and executed.
Agustín de Iturbide and the Final Royalist Betrayal

Spain and England won the Peninsular War in 1814, and Napoleon was defeated in 1815. Free of the Napoleonic Wars, Spain could again focus on its colonies. However, the return of the monarch and his strict policies upset many of the loyalists in the viceroyalties, as well as liberals within Spain. In March 1820, a revolt against Fernando VII forced him to accept the reinstatement of the Cadiz Constitution of 1812, which granted additional rights and privileges to those in the Spanish colonies.
By 1816, Spain had begun to lose control of South America; it simply lacked the resources to reassert its will, especially over its more distant colonies. In 1819, revolutionary Simón Bolívar declared the creation of a new nation, Gran Colombia, encompassing modern-day Panama, Bolivia (named after Bolívar), Colombia, Ecuador, and Peru. In Mexico, however, it was the conservative Agustín de Iturbide, a former loyalist, who switched sides and joined with the revolutionaries, who would create the plan for an independent Mexico.
The Treaty of Córdoba Guarantees Independence

Iturbide and revolutionary leader Vincente Guerrero created the Plan of Iguala in early 1821. It upheld the power of the Catholic Church and gave criollos equal rights and privileges to peninsulares, removing much loyalist resistance to independence. Without the support of the criollo class, New Spain’s last viceroy had no choice but to accept Mexico’s independence. On August 24, 1821, the Treaty of Córdoba was signed and granted Mexico formal independence from Spain, thus ending the Mexican War of Independence.
A supporter of the monarchy system, Iturbide became the emperor of the First Mexican Empire after marching his army into Mexico City on September 27. Iturbide was crowned on July 21, 1822. Its northern neighbor, the United States, recognized the new nation in December. Mexico had become a sovereign nation, recognized by others, but remained a monarchy.
From the Mexican Empire to a Mexican Republic

The First Mexican Empire included all of Central America north of Panama. However, Iturbide’s lavish spending, repressive tactics, and refusal to cooperate with Congress were opposed by many, including middle-class criollo Antonio López de Santa Anna, one of his lieutenants. He was forced to abdicate his throne in 1823. Central American provinces quickly declared their independence, forming the United Provinces of Central America, later the Central American Federation. This dissolution ended the First Mexican Empire, and the United Mexican States, a more modern republic, was created in 1824.
Despite the Treaty of Córdoba, during the 1820s, Spain refused to recognize Mexico’s independence. On October 1, 1823, King Ferdinand VII declared that all treaties and acts signed since the Revolution of 1820 were null and void. In 1829, Spain attempted to re-invade Mexico, leading to the Battle of Tampico. López de Santa Anna, who had retired to Veracruz after Iturbide resigned, defeated the Spanish and became a war hero. Only in 1836 did Spain finally accept Mexico’s independence with the Santa Maria-Calatrava Treaty.
Losing Ground: A Shrinking Mexico

The early decades of Mexico’s independence were turbulent. On-again, off-again president López de Santa Anna oversaw three significant losses of Mexican territory. In 1836, Mexico was forced to recognize the independence of the Republic of Texas, with Santa Anna signing a treaty as a prisoner taken in the Battle of San Jacinto. Texas later pursued statehood with the nearby United States of America, and annexation was completed in 1845. The very next year, Mexico and the United States engaged in warfare over disputed borders between the two countries. Mexico declared that Texas began at the Nueces River, while the US declared that it began further south and west, at the Rio Grande.
Although brief, the Mexican-American War resulted in a tremendous loss of territory for Mexico. The Mexican Cession gave the entire American Southwest, plus California, to the United States. Five years later, López de Santa Anna sold a final chunk of land in what is now southern Arizona and New Mexico to the United States. The Gadsden Purchase was made to acquire land for a railroad, end lingering border disputes, and allegedly raise money for López de Santa Anna himself. It was with this purchase, finalized in 1854, that the final boundaries of the US-Mexico border were established.











