Though his men had held their ground against repeated Confederate assaults, the sudden display of Southern aggressiveness at the Battle of Beaver Dam Creek shook Maj. Gen. George B. McClellan's confidence in his plan to capture Richmond. The June 26 battle and the belief that Stonewall Jackson's troops were still lurking somewhere off to his right and rear convinced McClellan that his lengthy supply train with its heavy siege guns were vulnerable to attack. In the pre-dawn hours of June 27, 1862 the commander of the Army of the Potomac issued a flurry of orders to his subordinates to move or abandon their supply trains and make a beeline for the James River where they would be protected by artillery fire from naval gun boats. Though he would never admit it, McClellan was retreating; the campaign to take Richmond was over.
To his most trusted subordinate, Fifth Corps commander Fitz-John Porter, McClellan assigned the task of holding the Federal line north of the Chickahominy River. Dawn broke over Porter’s men as they abandoned their position along Beaver Dam Creek and withdrew to a new line behind marshy creek called Boatswain’s Swamp. Here the Fifth Corps infantrymen were arrayed in an arc roughly one and three-quarters of a mile long while Yankee artillery stood guard over the bridges across the Chickahominy. Though slightly weaker than the position on the 26th, the Boatswain's Swamp was still a rather formidable obstacle, and the largely open farmland of the Watt, Adams, and McGehee families provided excellent fields of fire. With his troops aligned for battle, Porter was determined to withstand whatever the Rebels threw at him, "even to my destruction."
Gen. Robert E. Lee was determined to take advantage of the opportunity in front of him. His first offensive stroke as commander of the Army of Northern Virginia had prompted his opponent to surrender the initiative. Now Porter's entire corps was isolated north of the Chickahominy and Lee intended to destroy it. The Virginian sent word to Stonewall Jackson to link up with the main force before advancing on the Chickahominy.
A series of disjointed assaults by the divisions of A. P. Hill and D. H. Hill demonstrated the strength of the Federal position and yielded some of the highest casualties the war had yet seen. Additional troops under Richard S. Ewell and James Longstreet also pitched into the fray, but were unable to breach the Yankee line. Meanwhile, Porter's men held firm but were badly in need of reinforcement. Unfortunately, troops from the Sixth Corps had destroyed the nearest bridge over the Chickahominy, thus preventing the reinforcements from arriving in a timely fashion. When elements of the Sixth and Second corps finally arrived, it was too little too late. By then Jackson's men had arrived on the field and lent their weight to a twilight assault that ultimately overran the Union line.
Only darkness prevented a total catastrophe. Under the cover of night, Porter's men limped across the Chickahominy and set fire to the bridges behind them. The third of the Seven Days had ended in a resounding Confederate victory.