Barnard began practice in Rochester, New York, and served as prosecuting attorney of Monroe County in 1826.
Elected as an Adams to the Twentieth Congress, Barnard served as U.S. Representative for the twenty-seventh district of New York from March 4, 1827, to March 3, 1829. He was an unsuccessful candidate for reelection in 1828 to the Twenty-first Congress. He traveled in Europe in 1831, and moved to Albany, New York, in 1832 and continued the practice of law. He served as a member of the State assembly in 1838.
Barnard was elected as a Whig to the 26th, 27th and 28th United States Congresses, holding office from March 4, 1839, to March 3, 1845. He served as chairman of the Committee on the Judiciary (Twenty-seventh Congress). As a leading intellectual in the Whig party, Barnard gave a number of speeches, including to the literary societies of Amherst College in 1839[2] and to Yale Phi Beta Kappa Society in 1846.
Not a candidate for reelection in 1844, Barnard resumed his practice. He was appointed Envoy to Prussia and served from September 3, 1850, to September 21, 1853.[3] He retired from active business pursuits in 1853 and engaged in literary pursuits, residing in Albany, New York.