He was commissioned a Union Army lieutenant colonel on January 13, 1863, when his regiment was federalized as the 79th Regiment Infantry U.S. Colored Troops. On May 2 Williams was promoted to the rank of colonel, and on July 1-2 he fought at the Battle of Cabin Creek in the Indian Territory. About two weeks later he led his regiment during the Battle of Honey Springs, and Williams was wounded in this fight.