In 1850 Carpenter returned to resume his law practice in Beloit using a new name, Matthew (Matt) Hale Carpenter, after Sir Matthew Hale, the noted English jurist of the 17th century. Despite an earlier warning from Choate to steer clear of politics, Carpenter successfully ran for Rock County district attorney, serving from 1850 to 1852 and 1854 to 1856. He was a Democrat in the tradition of Thomas Jefferson and Andrew Jackson, but he disdained the party's pro-slavery platform while also rejecting Whig Party notions of opposing slavery based on "higher law"—the idea that individual belief of right and wrong permitted an individual to violate objectionable statutes and ordinances. After appearing to lose a close election for another term as Rock County district attorney in 1854, Carpenter successfully argued that courts could look beyond election board certifications and re-examine voter returns, resulting in the election being overturned.