 Mercer was elected a Federalist, Crawford Republican, Adams Republican, Anti-Jacksonian and Whig to the United States House of Representatives in 1816, serving from 1817 to 1839.There, he served as Chairman of the Committee on Roads and Canals from 1831 to 1839.Mercer was elected as a delegate to the Virginia Constitutional Convention of 1829-1830.