title: Mexican–American War
context: The Mexican–American War,[lower-alpha 1] also known in the United States as the Mexican War and in Mexico as the American intervention in Mexico,[lower-alpha 2] was an armed conflict between the United States of America and the United Mexican States (Mexico) from 1846 to 1848. It followed in the wake of the 1845 American annexation of the independent Republic of Texas. The unstable Mexican caudillo leadership of President/General Antonio López de Santa Anna still considered Texas to be its northeastern province and never recognized the Republic of Texas, which had seceded a decade earlier. In 1845, newly elected U.S. President James K. Polk sent troops to the disputed area and a diplomatic mission to Mexico. After Mexican forces attacked American forces, Polk cited this in his request that Congress declare war.
question: What years was the Mexican-American War?
answers: 1846 to 1848