<P> The border itself was not clearly defined and remained so until the Mexican colony became independent from Spain and entered a period of political instability . Mexico attempted to create a buffer zone at the border that would prevent possible invasion from the North . The Mexican government encouraged thousands of their own citizens to settle in the region that is now known as Texas and even offered inexpensive land to settlers from the United States in exchange for populating the area . The influx of people did not provide the defense that Mexico had hoped for and instead Texas declared its independence in 1836, which lasted until 1845 when the U.S. annexed it . </P> <P> The constant conflicts in the Texas region in the mid-19th century eventually led to the Mexican--American War, which began in 1846 and ended in 1848 with the Treaty of Guadalupe Hidalgo . In the terms of the peace treaty, Mexico lost more than 960,000 square miles (2,500,000 km) of land, 55% of its territory, including what is today California, Arizona, New Mexico, Utah, Nevada and parts of Colorado, Wyoming, Kansas, and Oklahoma . In addition, all disputes over Texas and the disputed territory between Rio Grande and Rio Nueces were abandoned . Five years later the Gadsden Purchase completed the creation of the current United States--Mexico border . The purchase was initially to accommodate a planned railway right - of - way . These purchases left approximately 300,000 people living in the once disputed lands, many of whom were Mexican nationals . Following the establishment of the current border a number of towns sprang up along this boundary and many of the Mexican citizens were given free land in the northern regions of Mexico in exchange for returning and repopulating the area . </P> <P> The Treaty of Guadalupe Hidalgo and another treaty in 1884 were the agreements originally responsible for the settlement of the international border, both of which specified that the middle of Rio Grande was the border--irrespective of any alterations in the channels or banks . The Rio Grande shifted south between 1852 and 1868, with the most radical shift in the river occurring after a flood in 1864 . By 1873 the moving river - center border had cut off approximately 600 acres (2.4 km) of Mexican territory in the El Paso - Juarez area, in effect transferring the land to the United States . By a treaty negotiated in 1963, Mexico regained most of this land in what became known as the Chamizal dispute and transferred 264 acres (1.07 km) in return to the United States . Border treaties are jointly administered by the International Boundary and Water Commission (IBWC), which was established in 1889 to maintain the border, allocate river waters between the two nations, and provide for flood control and water sanitation . Once viewed as a model of international cooperation, in recent decades the IBWC has been heavily criticized as an institutional anachronism, by - passed by modern social, environmental and political issues . </P> <P> The economic development of the border region on the Mexican side of the border depended largely on its proximity to the United States, due to its remoteness from commercial centers in Mexico . During the years of Mexican President Porfirio Díaz, between 1876 and 1910, the border communities boomed, due mostly to close ties to the United States, and the Mexican government's support for financial investments from the United States . Railroads were built that connected the northern Mexican states more to the United States than to Mexico and the population grew tremendously . The mining industry also developed, as did the United States' control of it . By the early 20th century companies from the United States controlled 81% of the mining industry and had invested five hundred million dollars in the Mexican economy overall, twenty - five percent of it in the border regions . </P>

How long is it from la to mexico