When Gillmore's corps was transferred to southeast Virginia, Foster was placed in command of the 1st Division, X Corps. During the Bermuda Hundred Campaign, Foster served as chief of staff to Gillmore. He returned to command the 1st Division briefly before reverting to brigade command. He led his brigade during the first and second battles of Deep Bottom. He commanded the 2nd Division, X Corps at the Battle of New Market Heights.