In September 1847, an American army under General Winfield Scott captured the Mexican capital in the Battle for Mexico City. Several months later, Mexican and American negotiators agreed to the Treaty of Guadalupe Hidalgo, under which Mexico agreed to recognize the Rio Grande as Texas's southern border and to cede Alta California and New Mexico. The Missouri Compromise had settled the issue of the geographic reach of slavery within the Louisiana Purchase territories by prohibiting slavery in states north of 36°30′ latitude, and Polk sought to extend this line into the newly acquired territory. However, the divisive issue of slavery blocked any such legislation. As his term came to a close, Polk signed the lone territorial bill passed by Congress, which established the Territory of Oregon and banned slavery in it. Polk declined to seek re-election in the 1848 presidential election, and the 1848 election was won by the Whig ticket of Zachary Taylor and Millard Fillmore.