During the spring of 1864, at the Battle of the Wilderness, Longstreet was severely wounded and Anderson took command of the First Corps, leading it throughout the Overland Campaign. After the Wilderness he fought well at the Battle of Spotsylvania Court House. Anderson and his corps executed an all-night forced march on May 7 that secured that important position (reinforcing the Confederate cavalry earlier sent there), and arrived just before Union soldiers did. Reaching and defending this spot denied the Federals a way around Lee's army towards Richmond, and Anderson held it during heavy fighting from May 8–12.