 He later served as an infantry second lieutenant at Fort Walla Walla in the Washington Territory on frontier duty from 1858-1861.In March 1861, shortly before the official secession of his home state, Anderson left the US Army and accepted a commission as a lieutenant of artillery in the Confederate Army, formally resigning his U.S. Army commission on May 17, 1861.In September 1861 he was promoted to the rank of Major, and was acting adjutant general of the troops on the Georgia coast.