In June 1861, Ewell was commissioned as a brigadier general in the service of the Confederacy. He commanded a brigade at First Manassas, thus making his mark as a leader. He was promoted to major general, to serve as a division commander during the Valley campaign of 1862. Subsequently, he served during the battle of Seven Days' and in the Second Manassas campaign, in which he lost a leg. He led the 2nd corps of the Army of Northern Virginia through the Battle of Gettysburg until health problems forced him to retire from the field after the battle of Spotsylvania Court House. He was in charge of the Richmond defenses until he was capture at the Battle of Sayler's Creek in April 1865.