During the winter of 1861–62, Hampton's Legion was assigned to the command of Gustavus W. Smith. Smith's division accompanied the rest of Joseph E. Johnston's Army of Northern Virginia down the Virginia Peninsula to aid in the Siege of Yorktown (1862) before Johnston withdrew to Richmond. On May 23, 1862, Hampton was promoted to brigadier general. At the Battle of Seven Pines on May 31, 1862, he was severely wounded in the foot, but while still under fire, remained on his horse while the foot was treated. Hampton returned to duty in time to fill in as leader of an infantry brigade for Stonewall Jackson at the end of the Seven Days Battles, although the brigade was not significantly engaged.