Foster was elected as a Democrat to the Fifty-sixth, Fifty-seventh, and Fifty-eighth Congresses (March 4, 1899 – March 3, 1905).[1] He was an unsuccessful candidate for reelection in 1904. He resumed the practice of law. He served as assistant corporation counsel of Chicago from 1912 to 1922. He retired from active pursuits in 1928 and moved to Wheaton, Illinois, where he died November 11, 1928. He was interred in Calvary Cemetery in Chicago.