Although he personally did not favor secession of Virginia from the Union, at the outset of the American Civil War (1861–1865), he helped form local militia in the Peninsula region of Hampton Roads. His work designing and constructing the Williamsburg Line of defensive works of the city and Fort Magruder at its center was a factor in delaying Federal troops attempting to chase retreating Confederates during the Peninsula Campaign, a failed attempt to capture the capital city of Richmond in 1862. His younger brother was Confederate General Richard S. Ewell, a senior commander under Stonewall Jackson and Robert E. Lee.