Just prior to the start of the American Civil War, Anderson was appointed a
captain of the Jefferson Rifles in the Florida Militia on January 11, 1861. Soon after Florida's secession, Anderson was one of three deputies (delegates) from Florida to the
Provisional Congress of the Confederate States, beginning February 4 and resigned on May 2. He accepted a commission as the
Colonel of the
1st Florida Infantry on April 1, and initially served under
Braxton Bragg in
Pensacola. There he commanded the 2nd Brigade in the Army of Pensacola from October 12 to January 27, 1862. He was promoted to the rank of
Brigadier general on February 10, 1862, and was assigned to the
Western Theater, commanding a brigade in the
Battle of Shiloh in April. He fought with the
Army of Tennessee during the battles of
Perryville,
Stones River,
Chickamauga, and
Chattanooga. Anderson was promoted to
Major general on February 17, 1864,. He served a brief stint (March–July 1864) commanding the Confederate District of Florida, before leaving to rejoin the
Army of Tennessee during the
Atlanta campaign. On July 29, he assumed command of
division previously commanded by to Maj. Gens.
Jones M. Withers and
Thomas C. Hindman. Anderson would lead the division, in Lt. Gen.
Stephen D. Lee's Corps at the
Utoy Creek, and in the early stages of the
Battle of Jonesboro before suffering a serious jaw wound on the evening of August 31. Temporarily unfit for duty, he was relieved of his command and sent home to Monticello. He later returned to duty in April 1865 during the
Carolinas campaign, against his physicians' orders, and served with his men for the remainder of the war until their surrender to
federal forces at
Greensboro, North Carolina, in the spring of 1865. He was paroled on May 1, and would be pardoned by the U.S. Government on December 2, 1866. ==Later life==