Lincoln had two vice presidents, one in each of his two terms. Both were US Senators before serving under Lincoln and both returned to the Senate after serving, Johnson after serving as vice president and then as president. Hannibal Hamlin and Lincoln had never met before being elected to serve together in 1860. Andrew Johnson and Lincoln worked closely together for two years to return Tennessee to the Union. Lincoln wanted Johnson as his running mate in 1864 because Johnson was a pro-Union Southern Democrat. Hamlin served in the Senate from 1848 to 1861 and 1869 to 1881. Johnson served in the Senate from 1857 to 1862 and again for a few months in 1875. He survived impeachment by one vote and is the only president to serve in the Senate after being president. John Quincy Adams served in the House after being president and William Howard Taft served as Chief Justice of the US Supreme Court after being president.