While he was unenthusiastic about secession, Hampton resigned his position in the South Carolina state senate in early 1861 and joined the Confederacy. Although he had no formal military training, his prestige helped secure him an appointment as a colonel. He soon organized “Hampton’s Legion,” a small force of cavalry, artillery and infantry. In July 1861 the newly formed unit participated in the First Battle of Bull Run (Manassas), and Hampton was wounded after the Legion came under heavy fire from Union troops.
The original elements of Hampton’s Legion were eventually reassigned to different commands in the Army of Northern Virginia, and in May 1862 Hampton was promoted to brigadier general. He commanded troops during the Peninsula Campaign and was wounded for the second time at the Battle of Seven Pines. He would return to the field during the Seven Days Battles in June and July 1862.
In July 1862 Hampton’s skill as a horseman saw him reassigned to command of a brigade of cavalry under General J.E.B. Stuart. He would go on to play a prominent role in Confederate cavalry actions, including leading the pursuit of retreating Union forces after the Second Battle of Bull Run (Manassas) in August 1862. A month later Hampton joined in Robert E. Lee’s invasion of Maryland and was involved in several small skirmishes prior to the Battle of Antietam. He then participated in a daring raid into Pennsylvania that captured the town of Chambersburg, and then led another expedition behind enemy lines in the lead-up to the Battle of Fredericksburg in December 1862. Desperate to defend his home state, Hampton repeatedly petitioned the Confederate high command for transfer to a new unit closer to South Carolina, but his requests were denied.
In the early stages of the Gettysburg Campaign in 1863, Hampton led his unit in the Battle of Brandy Station, the largest cavalry engagement of the Civil War. He later joined Stuart on a controversial raiding campaign that saw the Confederate cavalry advance to the outskirts of Washington, D.C. In July 1863 Hampton was involved in the Battle of Gettysburg, during which he received several saber wounds and was shot during fighting with Union cavalry on the second and third days of the engagement.
Hampton was promoted to major general that August, but his wounds kept him away from the field until November 1863. Following J.E.B. Stuart’s death at the Battle of Yellow Tavern in May 1864, Hampton assumed command of the Army of Northern Virginia’s cavalry corps. During the Overland Campaign in June 1864, Hampton won a major victory at the Battle of Trevilian Station, in which he repulsed repeated attacks by Union General Philip Sheridan and prevented the destruction of the Virginia Central Railroad. Hampton would later defend against Union cavalry menacing Richmond and Petersburg, and in September 1864 conducted the so-called “Beefsteak Raid,” a morale-boosting incursion behind enemy lines that captured over 2,000 head of cattle.
In January 1865 Hampton was sent to South Carolina on a recruiting and supply mission. A month later he was present for the fall of Columbia, South Carolina, to forces under the command of General William T. Sherman. Hampton received a promotion to lieutenant general in early 1865 and spent the latter stages of the war fighting in the Carolinas under General Joseph E. Johnston. He would surrender with Johnston in Durham in late April of 1865.