He held several local offices before being elected as a Democrat to the United States House of Representatives in 1848, serving from 1849 to 1851. He was elected judge of the thirteenth judicial circuit of Virginia on January 15, 1851. In this capacity, Parker presided over the trials of John Brown and his associates in 1859, sentencing them to death for their raid on nearby Harpers Ferry. He published in 1888 his recollections of the trial.