The Mexican-American War began in 1846 after Mexican forces attacked U.S. troops in Texas. Fighting ended in 1847 when U.S. General Winfield Scott occupied Mexico City. In the Treaty of Guadalupe Hidalgo in 1848, Mexico ceded California and New Mexico to the United States in addition to recognizing Texas as a U.S. state. The war resulted in the U.S. acquiring over 1 million square miles of Mexican territory but also high casualties, especially from disease, and increased political divisions over the expansion of slavery.