The United Mexican States is a North American country located between the United States to the north and Central America to its south, with Mexico City as its capital. Named for the dominant people of the Aztec Empire, the Mexica, Mexico was conquered by Spain starting in 1521 and known as "New Spain" until 1821. The Spanish conquistadors took advantage of Mexico's vast silver deposits and workforce of Native American obligatory laborers to transform New Spain into one of the Spanish Empire's wealthiest colonies, and, starting in 1571, the Mexican Inquisition accelerated a process of Catholicization, which came with assimilation into a hybrid Latin American culture. In 1810, Mexican priest Miguel Hidalgo y Costilla led an uprising against the Spanish authorities after the central Spanish government was overthrown by Napoleon's French armies in Europe, and Mexico won its independence in 1821 after a hard-fought war. Spanish rule was replaced by a short-lived First Mexican Empire, overthrown in 1823, and then by a fragile federal republic. Mexico was plagued by conflict between centralist and pro-Catholic Conservatives and federalist and anti-clerical Liberals for the first 35 years of its existence, and, while the Mexican government encouraged Anglo-American immigration into Tejas during the 1820s, the Conservative government's plan to centralize government rule in Mexico City and strip Tejas of its autonomy resulted in the Texas Revolution in 1835 and the secession of the Republic of Texas a year later. Mexico lost its sparsely-populated northern provinces of Alta California and New Mexico to the United States in the Mexican-American War of 1846-1848, leaving Mexico weakened. The ensuing decade saw Mexico fall into a civil war between rival Liberal and Conservative governments from 1858 to 1861, while the French invaded Mexico in 1861 to force Benito Juarez's liberal government to repay its mounting foreign debts. The French established a Second Mexican Empire as a puppet regime, but Juarez's liberal patriots overthrew the monarchy in 1867, forcing the French to retreat. Mexico was stabilized under the 35-year rule of dictator Porfirio Diaz from 1876 to 1911, rapidly modernizing with railroads, telecommunications, and investments in the arts and sciences. However, Diaz's decision to violate his promise not to seek re-election at the 1910 election, the centennial of Mexican independence, led to the Mexican Revolution, which inaugurated a decade of civil war and societal upheaval. The result was the creation of a secular, social democratic republic in which organized religion was persecuted, the power of landlords and clerics broken, and - over the next two decades - power centralized around the National Revolutionary Party, soon to become the Institutional Revolutionary Party (PRI). The PRI would rule over Mexico uninterrupted for 80 years, from 1920 to 2000, running the country as a corporatist state in which the country was run by representatives of each of Mexico's interest groups. After World War II, Mexico rapidly industrialized and urbanized, increasing inequality between urban and rural Mexico, while Mexico became a close ally of the United States. However, the 1968 Tlatelolco massacre and the Mexican Dirty War, coinciding with the global Cold War, led to the Mexican public coming to deeply mistrust the PRI government, while economic problems became widespread. President Carlos Salinas de Gortari oversaw neoliberal reforms during the 1980s, leading to the Chiapas rebellion in 1994. In 2000, conservative PAN presidential candidate Vicente Fox won power, ending the PRI's "perfect dictatorship"; in 2006, the PAN government initiated the "Mexican Drug War" to crack down on the militarized drug cartels that dominated whole cities and states. Mexico continued to contend with high crime rates, official corruption, drug trafficking, and a stagnant economy, accompanied by political instability.
By 2023, Mexico had a population of 129,875,529 people, of whom 62% were mestizo, 27% Native American, 9% white, 1% Black, and 1% Arab. The most mestizo state was Sinaloa (98.3%), the most Amerindian state was Oaxaca (69.17%), and the most white state was Sonora (42.54%). By 2020, 82.7% of Mexicans were Catholic, 5% evangelical, 1.6% Pentecostal, 1.4% Jehovah's Witnesses, and 4.7% none.