1848 Treaty of Guadalupe Hidalgo
In April 1847, President Polk sent Nicholas Trist to Mexico City as a commissioner to negotiate a settlement of the war. His instructions were to negotiate for California and New Mexico. In the midst of the negotiations; Polk decided to change Trist's instructions, and expand US demands. Trist felt an agreement was at hand, and ignored his recall. Soon, he succeeded in reaching an agreement.
Under the terms of the agreement, the Mexican War ended with the United States gaining a 33% increase in its territory. The United States agreed to pay Mexico $15 million for the territory and assume Mexican debts of over $3 million.
The price for the territory was paid not only in money, however. Thousands of Mexicans and Americans died in combat or from disease during the two year war, including more than 13,000 Americans.