This was the third of the Seven Days' Battles. On June 27, 1862, Gen. Robert E. Lee renewed his attacks against Porter's V Corps, which had established a strong defensive line behind Boatswain's Swamp north of the Chickahominy River. Porter's reinforced V Corps held fast for the afternoon against disjointed Confederate attacks, inflicting heavy casualties. At dusk, the Confederates finally mounted a coordinated assault that broke Porter's line and drove his soldiers back toward the river. The Federals retreated across the river during the night. Defeat at Gaines' Mill convinced McClellan to abandon his advance on Richmond and begin the retreat to James River. Gaines' Mill saved Richmond for the Confederacy in 1862.