This began with Polk wanting land for the United States. A couple of years before this John Tyler and James Polk had annexed Texas from the Mexicans (see Annexation of Texas page) which caused lots of tension between Mexico and America. Polk offered $20 million dollars to the President of Mexico for all of California, Utah, New Mexico, Arizona, and parts of Colorado. The Mexicans refused. The Mexicans and Americans were fighting over the border between Mexico and the United States. The Mexicans said the border ended at the Rio Grande, but the Americans said it ended at the Nueces River.
Polk sent troops to the disputed border to try and provoke a Mexican attack so he could get a permit to go to war with Mexico. He sent the troops to the Mexican side of the border, though. As expected, the Mexicans attacked the troops for intrusion on their land. President Polk, however, did not tell that side of the story to congress when he asked for his permit to go to war. He got his permit and then sent troops to California to conquer the Mexicans land. Some settlers in Mexico had heard about the troops coming and had decided to rebel against California. This was called the Bear Flag Rebellion. It was lead by John Fremont, a native of California. Polk's troops were met by Fremont and his troops and together they conquered California.
Many southerners and westerners liked this war because it gave them much more land for farming and other things, but some northerners did not like the war. They said it was unnecessary. One of these people included Abraham Lincoln. The Americans then started advancing farther and farther into Mexico until they reached and captured Mexico City.
Polk sent Nicholas Trist to negotiate a treaty with Mexico. Trist eventually came very close to a compromise, but Polk called him back fearing that Trist would try to take too much land. Trist refused and kept negotiating until he compromised on the Treaty of Guadelupe Hidalgo. The treaty said that the U.S. would get 55% of Mexico's land which included parts of present-day California, Arizona, New Mexico, Utah, Colorado, and Nevada. Also, Mexico would have to pay $3.25 million of Mexican debts to American citizens. America would pay Mexico $15 million dollars in return.