He resigned his commission January 27, 1862, to enter the Confederate Congress. On December 17, 1862, the South Carolina General Assembly elected Bonham as governor by secret ballot. He served until December 1864. During his term, the General Assembly enacted a prohibition against distilling in 1863 and also that year, it demanded that more land be used to grow food instead of cotton to increase the supply of food in the state. Bonham rejoined the Confederate Army as brigadier general of cavalry in February 1865, and was actively engaged in recruiting when the war ended.