In 1845, Mexico still claimed ownership to an enormous amount of territory that is now American soil. In addition, the Mexicans had still not gotten over the loss of Texas. So, when the United States annexed Texas in 1845, the stage was set for another conflict.
In America, the idea of Manifest Destiny was being discussed. The belief was that it was America's destiny to control all the territories from the east coast to the west coast. The president of the United States at that time was James K. Polk, and Polk was a strong advocate for Manifest Destiny.
Polk offered to buy Mexican territories in order to pursue America's Manifest Destiny. However, just as many Indians had refused to sell their lands to the government, the Mexicans refused to sell their territories.
Polk's solution to this was to send armies to Texas in order to instigate a conflict with Mexico. The plan worked, the Mexicans attacked and killed American soldiers: the Mexican American War was now inevitable. On May 13, 1846, the United States declared war on Mexico.
By this time, America had one of the strongest governments, economy, and military in the entire world. The disorganized Mexican government had little chance of defeating their American foe. In a short time Mexico City was occupied and the Mexicans were forced to agree to Polk's terms.
In 1848, Mexico signed the Treaty of Guadalupe Hidalgo. For 15 million dollars the United States gained all the Mexican territories north of the Rio Grande River, and California. Today this territory includes New Mexico, Utah, Nevada, Arizona, Texas, and part of Colorado.
Polk had achieved the American dream of Manifest Destiny.