Mexico and the United States have a complex history, with war in the 1840s and the subsequent American acquisition of more than 50% of former Mexican territory, including Texas, California, and New Mexico. Pressure from Washington forced the French invaders out in the 1860s. The Mexican Revolution of the 1910s saw many refugees flee North, and limited American invasions. Other tensions resulted from seizure of American mining and oil interests. The two nations share a maritime and land border. Several treaties have been concluded between the two nations bilaterally, such as the Gadsden Purchase, and multilaterally, such as the 2019 United States–Mexico–Canada Agreement, replacing the 1994 NAFTA. Both are members of various international organizations, including the Organization of American States and the United Nations. Since the late nineteenth century during the regime of President Porfirio Díaz (1876–1911), the two countries have had close diplomatic and economic ties. During Díaz's long presidency, U.S. businessmen acquired agricultural and mining interests in the country. The U.S. played an important role in the course of the Mexican Revolution (1910–20) with direct actions of the U.S. influencing the outcome. The long border between the two countries means that peace and security in that region are important to the U.S.'s national security and international trade. The U.S. is Mexico's biggest trading partner and Mexico is the U.S.'s third-largest trading partner. In 2010, Mexico's exports totaled US$309.6 billion, and almost three quarters of those purchases were made by the United States. They are also closely connected demographically, with over one million U.S. citizens living in Mexico and Mexico being the largest source of immigrants to the United States, with about 8-10 million Mexican immigrants in the US. While condemning the terrorist attacks of 9/11 and providing considerable relief aid to the U.S. after Hurricane Katrina, the Mexican government, pursuing neutrality in international affairs, opted not to actively join the War on Terror and the Iraq War, instead being the first nation in history to formally and voluntarily leave the Inter-American Treaty of Reciprocal Assistance in 2002, though Mexico later joined the U.S. in supporting military intervention in the Libyan Civil War. History The United States of America shares a unique and often complex relationship with the United Mexican States. With shared history stemming back to the Texas Revolution (1835–1836) and the Mexican–American War (1846–1848), several treaties have been concluded between the two nations, most notably the Gadsden