After the Texas annexation, Polk turned his attention to California, hoping to acquire the territory from Mexico before any European nation did so. The main interest was
San Francisco Bay as an access point for trade with Asia. In 1845, he sent diplomat
John Slidell to Mexico to purchase California and
New Mexico for $20-30 million
US dollars. Slidell's arrival caused political turmoil in Mexico after word leaked out that he was there to purchase additional territory and not to offer compensation for the loss of Texas. The Mexicans refused to receive Slidell, citing a technical problem with his credentials. In January 1846 to increase pressure on Mexico to negotiate, Polk sent troops under General
Zachary Taylor into the area between the
Nueces River and the
Rio Grande—territory that was claimed by both the U.S. and Mexico.
Slidell returned to Washington in May 1846, having been rebuffed by the Mexican government. Polk regarded this treatment of his diplomat as an insult and an "ample cause of war", and he prepared to ask Congress for a declaration of war. Coincidentally, mere days before Polk intended to make his request to Congress, he received word that Mexican forces had crossed the Rio Grande area and killed eleven American troops. Polk then made this the
casus belli, and in a message to Congress on
May 11, 1846, he stated that Mexico had "invaded our territory and shed American blood upon the American soil." Several congressmen, including a young
Abraham Lincoln, expressed doubts about Polk's version of events,
but Congress overwhelmingly approved the declaration of war, many Whigs fearing that opposition would cost them politically by casting themselves as unpatriotic for not supporting the war effort.
In the House, anti-slavery Whigs led by
John Quincy Adams voted against the war; among Democrats, Senator
John C. Calhoun was the most notable opponent of the declaration.
By the summer of 1846, American forces under General
Stephen W. Kearny had captured New Mexico. Meanwhile, Army captain
John C. Frémont led settlers in northern California to overthrow the Mexican garrison in Sonoma. General Zachary Taylor, at the same time, was having success on the Rio Grande, although Polk did not reinforce his troops there. The United States also negotiated a secret arrangement with
Antonio López de Santa Anna, the Mexican general and dictator who had been overthrown in 1844. Santa Anna agreed that, if given safe passage into Mexico, he would attempt to persuade those in power to sell California and New Mexico to the United States. Once he reached Mexico, however, he reneged on his agreement, declared himself President, and tried to drive the American invaders back. Santa Anna's efforts, however, were in vain, as generals Zachary Taylor and
Winfield Scott destroyed all resistance. Scott captured Mexico City in September of 1847, and Taylor won a series of victories in Northern Mexico. Even after these battles, Mexico did not surrender until 1848, when they agreed to peace terms set out by Polk.
Polk sent diplomat
Nicholas Trist to negotiate with the Mexicans. Lack of progress prompted the President to order Trist to return to the United States, but the diplomat ignored the instructions and stayed in Mexico to continue bargaining. Trist successfully negotiated the
Treaty of Guadalupe Hidalgo in 1848, which Polk agreed to ratify, ignoring calls from Democrats who demanded the annexation of the whole of Mexico. The treaty added 1.2 million square miles (3.1 million km²) of territory to the United States; Mexico's size was halved, whilst that of the United States increased by a third. California,
New Mexico, Arizona, Nevada, Utah, and parts of
Colorado and Wyoming were all included in the Mexican Cession. The treaty also recognized the annexation of Texas and acknowledged American control over the disputed territory between the
Nueces River and the Rio Grande. Mexico, in turn, received the sum of $15 million. The war claimed less than 20,000 American casualties but over 50,000 Mexican casualties. It had cost the United States nearly $100 million. Finally, the
Wilmot Proviso injected the issue of slavery in the new territories, even though Polk had insisted to other congressmen and in his diary that this had never been a war goal.
The treaty, however, needed ratification by the Senate. In March 1848, the Whigs, who had been so opposed to Polk's policy, suddenly changed position. Two-thirds of the Whigs voted for Polk's treaty. This ended the war and legalized the acquisition of the territories. Later in 1848, the Whigs nominated
Zachary Taylor, the hero of the war, for president. Taylor said there would be no future wars, but he refused to criticize Polk, who kept his promise not to run for reelection.
The war had serious consequences for Polk and the Democrats. One was that the war had given the Whig Party a unifying message of denouncing the war as a whole (even though they did vote for the funding of it) as an immoral abuse of power by the President by taking land from Mexico. In 1848, the House of Representatives voted to censure Polk for starting the war. The second was that the war had taken a toll on Polk's health. As a result of Polk managing the war effort directly, and by paying attention to every detail very closely, his health markedly declined toward the end of his presidency. The contrary view, born out by common sense, is that paying attention to details while managing a complicated endeavor does not usually cause grave illness, which, in this case caused Polk to die 3 months after the end of his presidency. So there is serious doubt that the war caused Polk to become ill.