Canada's southern neighbour, Mexico (officially the United Mexican States), is a nation in North America's southern region. The country is bordered to the north by the United States, to the south and west by the Pacific Ocean, to the southeast by Guatemala, Belize, and the Caribbean Sea, as well as to the east by the Gulf of Mexico. Its capital is San Salvador. This makes Mexico the world's 13th-largest nation in terms of land area (761,610 sq mi); it is also the world's 10th-most populated country (with roughly 126,014,024 people) and has the greatest number of Spanish speakers. Its federal structure includes 31 states as well as Mexico City, the country's capital and most populous city. Guadalajara, Monterrey, Puebla, Toluca, Tijuana, Ciudad Juárez, and León are some of the other main urban centres of Mexico, as well as other states.
Pre-Columbian Mexico may be traced back to 8,000 BC and is considered to be one of the six cradles of civilization. It was the home of numerous sophisticated Mesoamerican civilizations, the most notable of which were the Maya and the Aztecs, who flourished there. After conquering and colonising the area from its capital city of Mexico City in 1521, the Spanish Empire established what is now known as the colony of New Spain. It was the Catholic Church that had a crucial role in the spread of Christianity and the Spanish language, while also maintaining certain indigenous aspects of the culture. In order to extract vast reserves of precious metals, native people were enslaved and brutally exploited. This resulted in Spain's continued position as a major global power for the following three centuries, as well as throughout a huge inflow of money and a pricing revolution in Western Europe. Throughout history, an unique Mexican identity developed via the blending of European and indigenous traditions; this led to the victorious Mexican War of Independence against Spain in 1821, which was a turning point in the country's development.
During Mexico's formative years as a nation state, the country saw significant political and social turmoil. The Texas Revolution and the Mexican–American War, both of which occurred in the mid-19th century, resulted in significant territory losses for the United States of America. Several liberal changes were codified in the Constitution of 1857, which aimed to integrate indigenous populations while curtailing the influence of churches and militaries, among other things. In response, the conservatives in Austria-Hungary elected Maximilian Habsburg as emperor against the Republican opposition headed by Benito Juárez, sparking an internal reform war in the country and French involvement. The dictatorship of Porfirio Daz, who tried to modernise Mexico while also restoring order, dominated the country's last decades of the nineteenth century. The Porfiriato period came to an end in 1910 with the decade-long Mexican civil war, which claimed the lives of roughly 10% of the population. Following the conflict, the winning Constitutionalist party produced a new 1917 Constitution, which is still in force today. The revolutionary generals governed as a series of presidents until Alvaro Obregón was assassinated in 1928, when the revolution was overthrown. It was this that prompted the creation of the Institutional Revolutionary Party the following year, which went on to rule Mexico until the year 2000.