His first foray into political life came in 1838 when he ran unsuccessfully for the State Legislature; he gained a term in 1841. In the Presidential campaign of 1840, he acquired the reputation of being one of the ablest speakers on the Whig side. He was elected to the United States Congress from his district in 1843, and re-elected in 1845, 1847 (when he was chairman of the Committee on Roads and Canals) and 1849. His first conspicuous work was to help repeal the gag rule that had long been used to prevent antislavery petitions being read on the floor of the house. He opposed the Mexican–American War as a war of aggression to further slavery.