 In early 1856 he became a captain for Colonel Jack Allen's Kentucky Rifles, a group under William Walker.At the Siege of Granada, Nicaragua (November 24 – December 11, 1856), he was seriously wounded.After the initial seven states seceded from the United States to form the Confederate States of America, Anderson journeyed in March 1861 to the then-capital of the Confederacy at Montgomery, Alabama, to volunteer the services of several Kentuckians for the Confederate Army.