Rather than retiring from public service, Adams won election to the House of Representatives, where he would serve from 1831 to his death in 1848. He joined the Anti-Masonic Party in the early 1830s before becoming a member of the Whig Party, which united those opposed to President Jackson. During his time in Congress, Adams became increasingly critical of slavery and of the Southern leaders whom he believed controlled the Democratic Party. He was particularly opposed to the annexation of Texas and the Mexican–American War, which he saw as a war to extend slavery. He also led the repeal of the 'gag rule', which had prevented the House of Representatives from debating petitions to abolish slavery. Historians generally concur that Adams was one of the greatest diplomats and secretaries of state in American history. They typically