With the outbreak of the Civil War and Virginia's eventual secession, Walker entered the Confederate Army in April 1861 as captain of the "Pulaski Guards", which soon became Company C of the 4th Virginia Infantry.
He led it during the Gettysburg Campaign, where the brigade participated in the attacks on Culp's Hill.