This was the first armed conflict involving the United States, chiefly fought on foreign soil. Through this war we won the right to buy the territory that is now New Mexico, Arizona, Oregon, Utah, and California which was negotiated in the Treaty of Guadalupe Hidalgo. Mexico received $15 million in compensation, the same as France for the Louisiana Territory.
The United States Government had been trying to buy this land since they Annexed Texas but Mexico wouldn't sell. In order to acquire this land President James K. Polk knew we would have to take it by force. After approaching Congress for a Declaration of War, they denied the motion stating that it wasn't a good enough reason. President Polk however was too deeply rooted in the manifest destiny of the United States, he would find a way to get that land.
President Polk knew that he could not invade this Mexican Territory without Congress's approval, but he knew if U.S. troops were attacked Congress would have to approve in invasion. So, as Commander in Chief, he strategically placed a Cavalry battalion in between the Rio Grande and the Nueces River, which was disputed land from when Texas seceded in 1836. Texas said there land went as far South as the Rio Grande but the Mexican Government claimed the land between the Rio Grande and the Nueces was theirs.
The President's plan worked perfectly. Our soldiers were attacked which prompted an immediate response from Congress in retaliation. In less than two years the United States controlled all of Mexico. We then offered them a fair sum on money for the land we wanted and gave them back more than half of their country.