From the very beginning of his service in Congress, Hamlin was prominent as an opponent of the extension of slavery. He was a conspicuous supporter of the Wilmot Proviso and spoke against the Compromise of 1850. In 1854, Hamlin strongly opposed the passage of the Kansas–Nebraska Act, which repealed the Missouri Compromise. After the Democratic Party endorsed that repeal at the 1856 Democratic National Convention, on June 12, 1856, he withdrew from the Democratic Party and joined the newly organized Republican Party, causing a national sensation.