According to the International Boundary and Water Commission, the continental border then follows the middle of the Rio Grande—according to the 1848 Treaty of Guadalupe Hidalgo between the two nations, "along the deepest channel" (also known as the thalweg)—a distance of 2020 kilometers to its mouth at the Gulf of Mexico.