<P> The Mexican--American War, also known as the Mexican War in the United States and in Mexico as the American intervention in Mexico, 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, which Mexico still considered its northeastern province and a part of its territory after its de facto secession in the 1836 Texas Revolution a decade earlier . </P> <P> Mexico obtained independence from the Kingdom of Spain and the Spanish Empire with the Treaty of Córdoba in 1821, and briefly experimented with monarchy, becoming a republic in 1824 . It was characterized by considerable instability, leaving it ill - prepared for international conflict only two decades later, when war broke out in 1846 . In the decades preceding the war, Native American raids in Mexico's sparsely settled north prompted the Mexican government to sponsor migration from the United States to the Mexican province of Texas to create a buffer . However, the newly named "Texians" revolted against the Mexican government of President / dictator Antonio López de Santa Anna, who had usurped the Mexican Constitution of 1824, in the subsequent 1836 Texas Revolution, creating a republic not recognized by Mexico, which still claimed it as part of its national territory . In 1845, the Texan Republic agreed to an offer of annexation by the U.S. Congress and became the 28th state in the Union on December 29 that year . </P> <P> In 1845, newly elected U.S. President James K. Polk made a proposition to the Mexican government to purchase the disputed lands between the Nueces River and the Rio Grande river further south . When that offer was rejected, President Polk moved U.S. troops commanded by Major General Zachary Taylor further south into the disputed territory . Mexican forces attacked an American Army outpost ("Thornton Affair") in the occupied territory, killing 12 U.S. soldiers and capturing 52 . These same Mexican troops later laid siege to an American fort along the Rio Grande . Polk cited this attack as an invasion of U.S. territory and requested that the Congress declare war . </P> <P> U.S. forces quickly occupied the capital town of Santa Fe de Nuevo México along the upper Rio Grande and the Pacific coast territory province of Alta California (Upper California). They then invaded to the south into parts of central Mexico (modern - day northeastern Mexico and northwest Mexico). Meanwhile, the Pacific Squadron of the United States Navy conducted a blockade and took control of several garrisons on the Pacific coast farther south in lower Baja California Territory . The U.S. Army, under the command of Major General Winfield Scott, after several fierce battles of stiff resistance from the Mexican Army outside of the capital, Mexico City, eventually captured the city, having marched west from the port of Veracruz, where the Americans staged their first amphibious landing on the Gulf of Mexico coast . </P>

How did the u.s. first attempt to acquire mexico’s northern territories
find me the text answering this question