The United States and Mexico share a maritime and land border and by the 21st century, the two countries had close economic ties, being each other's first and third largest trading partners. They are also closely connected demographically, with more than 1 million U.S. citizens living in Mexico and Mexico being the largest source of immigrants to the United States. The countries' relationship began 200 years earlier amid dispute and warfare.
When the United States fought to gain its independence of Great Britain (1775-1783), modern Mexico was under the control of the Spanish Empire, and Spain served as an ally of the Americans. In the early 19th century, the rapidly expanding United States claimed that Texas was part of the territory of Louisiana, and therefore had been rightfully acquired as part of the Louisiana Purchase from France (1803). The Spanish claimed Texas as part of its territory, a dispute not resolved until the Adams-Onis Treaty in 1819, when the U.S. dropped its claim to Texas by instead purchased Florida from Spain.
After its own war of independence, Mexico broke away from Spain in 1821 and was soon recognized by the United States. Texas, though, would return as a point of conflict between the two new nations. Americans and other non-Mexicans began to settle in eastern Texas in large numbers. These "Texians," often rejected Mexican rule, leading to the Texas Revolution of 1835. In 1845 the United States annexed Texas, prompting the U.S.-Mexico War (1846-48), which resulted in Mexico being forced to sell California and New Mexico to the U.S. The Treaty of Guadalupe Hidalgo (1848) failed to provide resolution to the dispute. Errors in surveying turned the Mesilla Valley into another disputed territory, which was finally sold to the United States as a part of the Gadsden Purchase (1853).
Territorial disputes were also related to changes in the course of the river Rio Grande (or Rio Bravo as it is called in Mexico). An area called El Chamizal was annexed by the U.S. in 1864, but the dispute continued for 99 years. In 1916, during a civil war in Mexico, the rebel leader Pancho Villa conducted a raid into American territory which prompted the U.S. President, Woodrow Wilson, to order General John Pershing and a force of 100,000 to pursue Villa into Mexican territory. The pursuit was only called off in 1917 when the United States entered World War I.
In 1970, when the nations signed a treaty to resolve existing and future boundary disagreements. With territorial frictions eased, the countries were better able to pursue trade and other agreements. In 1994 the United States, Canada and Mexico joined the North American Free Trade Agreement (NAFTA). As a result of NAFTA, Mexico's farmers have gained broader access to international markets. Mexico's fruit and vegetable exports to the U.S. surpassed $4.7 billion in 2009.
Chief U.S. exports to Mexico are electronic equipment, motor vehicle parts, and chemicals. Mexico's imports from the United States stood at $112 billion (or 48 percent of total) in 2009. In the same year, exports from Mexico to the United States amounted to $185 billion (or 80 percent of the country's total exports). In 2009, when Mexico was the world's seventh-biggest producer of crude oil, it was also the second-largest oil supplier to the United States. U.S. businesses have invested heavily in Mexico, with U.S. foreign direct investment (FDI) in the country reaching $6.4 billion, or 45 percent of the overall FDI in Mexico, in 2009.
Among problems that have strained bilateral relations is illegal immigration. Regardless of the tough controls implemented on the U.S.-Mexico border, illegal immigration persists as it is supported by criminal syndicates in Mexico. Smuggling of illegal goods and narcotics is also a problem. The border between the United States and Mexico is one of the busiest in the world, with about one million legal crossing registered every day.
At the August 2007 North American Leaders' Summit in Montebello, presidents George W. Bush (b 1946) and Felipe Calderon (b 1962) announced the Merida Initiative. It envisages co-operation between North American and Central American countries to combat drug trafficking and organized crime.