In 1855, he became the mayor of St. Paul, Minnesota. Ramsey was elected the second Governor of Minnesota after statehood and served from January 2, 1860 to July 10, 1863. Ramsey is credited with being the first Union governor to commit troops during the American Civil War (he happened to be in Washington, D.C. when fighting broke out). He resigned the governorship to become a U.S. Senator, having been elected to that post in 1863 as a Republican. He was re-elected in 1869 and held the office until March 3, 1875, serving in the 38th, 39th, 40th, 41st, 42nd, and 43rd congresses.