Hamlin studied law. He was admitted to the legal profession in 1833, and quickly became known as a good lawyer and a good speaker. In politics, he began as an against slavery Democrat. He was a member of the state House of Representatives from 1836-1840, in charge of the House during the last four years. He was a representative in Congress from 1843 to 1847, and a Senator of the United States Senate from 1848 to 1856. From the very beginning of his service in Congress he was a well-known opponent of the extension of slavery; a notable supporter of the Wilmot Proviso, an opponent of the Missouri Compromise, and in 1856, he left the Democrats and joined the new Republican party. 