The Battle of Gaines' Mill, also known as the First Battle of Cold Harbor or the Battle of Chickahominy River, took place on June 27, 1862, in Hanover County, Virginia, as the third of the Seven Days Battles (Peninsula Campaign) of the American Civil War. Confederate General Robert E. Lee renewed his attacks against Union Brig. Gen. Fitz John 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 on the attackers.|
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 Army of the Potomac commander Maj. Gen. George B. McClellan to abandon his advance on Richmond and begin the retreat to the James River. The Confederates were too disorganized to encircle and then pursue the main Union force. Gaines' Mill saved Richmond for the Confederacy in 1862. The battle occurred in almost the same location as the 1864 Battle of Cold Harbor and had similar numbers of total casualties.