Pegram was given command of a veteran Virginia infantry brigade in the division of Jubal A. Early. In May, Pegram was wounded at the Battle of the Wilderness and went home to recuperate. Returning to field duty that fall, he served with distinction during Early's independent Valley Campaign as a division commander. Following the disastrous Battle of Cedar Creek, Early's survivors, including Pegram, returned to the Army of Northern Virginia in the Petersburg trenches.