On October 1, 1865, Williams was mustered out of the volunteer service. He was commissioned a captain in the new 8th U.S. Cavalry Regiment of the regular army on July 28, 1866., commanding Company I. The 8th Cavalry was at first based out of Fort Whipple in the Arizona Territory, but later stationed at Fort Selden and Fort Bayard, both in the New Mexico Territory. Williams was brevetted a major on July 9, 1867, for his service during the Indian Wars.