When the American Civil War began in 1861, Anderson chose to follow his home state of Georgia and the Confederate cause. He was elected captain in the 6th Georgia Infantry on May 27, and assigned to command of the regiment's Company C. That October he led the forces guarding Choctaw and Owen Bluffs in Alabama. Anderson participated in the Maryland Campaign in the fall of 1862, fighting during the Battle of Antietam on September 17. In the fight he was wounded and captured by Union forces, and exchanged later that year. Upon release Anderson was promoted to major, effective back to the date of the Battle of Antietam. That December he took part in the Fredericksburg Campaign.