The Mexican War began in 1846 as a result of a border dispute between the United States and Mexico and America's desire to extend its territory westward in line with Manifest Destiny. President Polk provoked Mexico into conflict so he could justify war, and the U.S. quickly gained control of New Mexico and California. The 1848 Treaty of Guadalupe Hidalgo ended the war, with Mexico ceding those territories to the U.S. in the Mexican Cession in exchange for $15 million.