Following the annexation of Texas in 1845, President Polk began preparations for a potential war with Mexico, which still regarded Texas as a part of its republic. After a skirmish known as the Thornton Affair broke out on the northern side of the Rio Grande, Polk convinced Congress to declare war against Mexico. Though most Democrats and Whigs initially supported the war, Adams and some other anti-slavery Whigs attacked the war as a "Slave Power" plot designed to expand slavery across North America. Meanwhile, former Democratic Congressman John P. Hale had defied party leaders by denouncing the annexation of Texas, causing him to lose re-election in 1845. Hale joined with anti-slavery Whigs and the Liberty Party to found a new party in New Hampshire, and he won election to the Senate in early 1847. In New York, tensions between the anti-slavery Barnburner and the conservative Hunker factions of the Democratic Party rose, as the Hunkers allied with the Whigs to defeat the re-election campaign of Democratic Governor Silas Wright.