qnli question: What was the name of the treaty that ended the war? sentence: The Treaty of Guadalupe Hidalgo, signed on February 2, 1848, by American diplomat Nicholas Trist and Mexican plenipotentiary representatives Luis G. Cuevas, Bernardo Couto, and Miguel Atristain, ended the war, gave the U.S. undisputed control of Texas, and established the U.S.–Mexican border of the Rio Grande.