The Battle of Totopotomoy Creek was part of the Overland Campaign of 1864. Union forces were pushing closer to Richmond after bloody fighting at the Wilderness, Spotsylvania, and North Anna, trying to maneuver to the east and south to get around Robert E. Lee's Army of Northern Virginia. A sharp cavalry fight on May 28 compelled both armies to send infantry to the banks of Totopotomoy Creek. The Confederates constructed a line of breastworks on a ridge overlooking the creek, forcing the Federals to halt and look for a path around the fortifications. Union probes continued throughout May 29 as other elements crossed the creek further to the east, threatening to swing back towards the main battlefield and strike Lee's army from the flank and rear. On May 30, Lee ordered a coordinated attack on this flanking column. The Confederates achieved initial success, driving back several Union divisions, but their efforts climaxed with a costly repulse in the face of the reformed Union line. The impending arrival of Union reinforcements from Bermuda Hundred compelled the Confederates to abandon their Totopotomoy line and race to occupy Cold Harbor.