He was a member of the Massachusetts House of Representatives from 1781 to 1784, and again in 1788. He was a member of the convention which adopted the Constitution of the United States in 1788. He served in the Massachusetts Senate the next year. He was appointed high sheriff of Essex County by Governor John Hancock and served from July 1, 1789, until December 5, 1811. He was elected as a Federalist to the Fifth Congress to fill the vacancy after the resignation of Theophilus Bradbury. He was reelected to the Sixth Congress and served from November 27, 1797 to March 3, 1801. He was not a candidate for renomination in 1800. He served as treasurer of Essex County in 1812. He was again appointed high sheriff of Essex County on June 20, 1812, and served until his death. He was a delegate to the State constitutional convention in 1820.