Despite the battlefield victory at Beaver Dam Creek on the evening of June 26, 1862, the Union Fifth Corps under Fitz John Porter abandoned the strong position there shortly after midnight. Army commander George B. McClellan, aware of an approaching Confederate column under “Stonewall” Jackson, decided to relocate his base of operations south to the James River. For the next five days his army moved toward the river, fighting a series of rearguard battles in a desperate effort to stave off triumphant Confederates. The Battle of Gaines’s Mill, on June 27, marked the first in that series of battles.
McClellan deployed Porter’s Fifth Corps across an arc of 1 ½ miles, with its back to the swampy Chickahominy River. Porter recognized that his assignment was to hold off the pursuing Confederates while the balance of the Union army began its movement toward the James. With only 27,000 men, Porter had little hope of achieving any great victory, particularly when R. E. Lee brought approximately 60,000 Confederates to the attack. A small force of reenforcements elevated Porter’s strength to 34,000, but Lee enjoyed a great numerical advantage—one of the largest of the war for his army.
Although not entrenched in the usual style, the Union infantry made full use of the terrain and enjoyed fine fields of fire. Abundant artillery helped Porter’s men as the battle grew in scope and violence. The initial Confederate attacks only began at about 2:30, leaving just 5 ½ hours of daylight. For both sides, the ticking clock was of critical importance. If Porter’s men could survive until sunset, darkness would shelter their withdrawal across the river. If Lee could shatter the Union line during the daylight hours, he stood a real chance of fully destroying Porter’s command by driving it into the river.