Under the treaty of Guadalupe Hidalgo, the Mexican-American war ended, and Mexico recognized the Rio Grande River as the southern border of the United States, relinquished all claims to Texas, and ceded 525,000 square miles to the United States. The United States agreed to pay Mexico $15 million and settle any claims of its citizens against Mexico.
Under the original terms of the treaty, the United States was to recognize any land grant deeds awarded by either Spain or Mexico and held by Mexican citizens and to offer them immediate citizenship. However, Congress refused to accept these terms, changing the ratified version so that Congress had the power to decide when to admit these Mexican citizens as citizens of the United States.
This land ceded from Mexico included all or part of present-day California, Arizona, New Mexico, Utah, Wyoming, Colorado and Nevada. In 1853, the United States paid Mexico another $10 million to purchase what is present-day southern Arizona and New Mexico, cementing most of the southern border with Mexico. The United States wanted the additional land for construction of a southern transcontinental railroad, although the plans were put on hold until after the Civil War.
The two-year war with Mexico cost President Polk popularity with the people, so he did not seek re-election. The new lands increased the arguments over slavery, which led to the Civil War in the 1860s.