Williams was a probate court judge from 1857 to 1865 and a member of the Michigan Senate from 1866 to 1870, serving as president pro tempore in 1869. He was also a member of the State constitutional convention in 1867, and a Michigan delegate to 1868 Republican National Convention. In 1871, he was appointed by Governor Henry P. Baldwin to serve as a member of the State board for the supervisory control of the charitable, penal, and beneficiary institutions, which position he resigned upon his election to the U.S. Congress.