 He was a member of the New York State Assembly in 1866 (Erie Co., 1st D.), and 1867 (Erie Co., 2nd D.).Williams was elected as a Democrat to the Forty-second Congress (March 4, 1871 – March 3, 1873).He was an unsuccessful candidate for reelection in 1872 to the Forty-third Congress.