Sanders attended the United States Military Academy at West Point from 1852 to 1856, but was not an outstanding cadet, graduating 41st in his class. West Point Superintendent Robert E. Lee wrote a May 1854 letter announcing Sanders' dismissal, but he managed to avoid dismissal with the help of the U.S. Secretary of War Jefferson Davis. Sanders graduated in 1856, and served in the western territories (including Utah). He was commissioned a brevet second lieutenant in the 1st U.S. Dragoons on July 1, 1856. He became second lieutenant in the 2nd U.S. Dragoons on May 27, 1857.