In 1860, Hamlin was put on the ballot as the Republican Party's vice president candidate with Abraham Lincoln. Hamlin complemented Lincoln well because he was from the Northeast, whereas Lincoln was from Illinois. Hamlin did not want to be nominated for the position, but he decided to follow it through to be loyal to his political party and to the abolition of slavery in the United States. As Vice President, however, Lincoln did not use Hamlin often for support, and Hamlin, for the first time in his political career, was not representing people from Maine. In the 1864 election, Hamlin was not up for re-election and was instead replaced with Southerner Andrew Johnson.
After his term as Vice President, Hamlin was a port collector in Boston and served as president of a railroad company. Despite leaving government for a short time, Hamlin went back and served as a Senator from 1869 to 1881. He then became Minister to Spain in 1881. He returned from Spain in 1882 and returned to his home in Bangor, Maine.