Ramsey was elected from Pennsylvania as a Whig to the U.S. House of Representatives and served in the 28th and 29th congresses from March 4, 1843 to March 3, 1847. He served as the first Territorial Governor of Minnesota June 1, 1849 to May 15, 1853 as a member of the Whig Party.