Hamlin's political career began in 1835, when he was elected to the Maine House of Representatives.
Hamlin unsuccessfully ran for the United States House of Representatives in 1840 and left the State House in 1841.