Ironically, Lee's success in pushing the Union army away from Richmond had the adverse effect of strengthening McClellan's overall military line. At the outset of the Seven Days' Battles, the Union army was fragmented. Fitz-John Porter's Fifth Corps was isolated on the north side of the Chickahominy River, while the rest of the army was positioned on the opposite side of the river and to the south. Through a series of organized retreats at Mechanicsville, Gaines's Mill, Savage's Station, and Glendale, McClellan was able to organize the Union army into a unified and fortified position when he withdrew to Malvern Hill.
From the beginning of the Seven Day's Battles, Lee's offensive strategy was plagued by overly complex battle plans, geographical obstacles, and poor performances by his division commanders. These impediments held true once more at the Battle of Glendale. After an unsuccessful attempt to overrun a portion of McClellan's troops the previous day at Savage's Station, Lee devised a new battle plan aimed at cutting off the Union army from the James River. Lee's intricate plan called for a central assault to be delivered by James Longstreet and A. P. Hill, attacking the Union army from the west just outside the village of Glendale. Strong support was to come from division commanders Benjamin Huger and John B. Magruder assaulting the left and right flanks of the Union line. Meanwhile, Jackson, with fully one-third of the Confederate force, was to rebuild the bridge destroyed in the previous day's fighting at Savage's Station, overwhelm the remaining Union troops positioned there, and then march two miles south, coming up behind the Union forces fighting Longstreet and Hill, effectively sandwiching the entire Union army.
In addition to Huger and Magruder's failure to enter the fray, the expected support from Jackson's troops to the north never materialized. In what may be his worst performance during the Civil War, Jackson, exhausted and lethargic, failed to rebuild the bridge due to Union artillery and sharpshooters. Seeing no way to cross the creek, he recalled his troops from danger and lay down to sleep under a tree. Even later, when his staff officers roused him to report an alternate route to ford the river with infantry, Jackson disregarded their findings and remained asleep beneath the tree while gunfire from Glendale sounded in the distance.
The fighting at Glendale ended that night with the Union suffering 3,800 casualties, compared to 3,700 for the Confederates. Under the cover of darkness, McClellan was able to withdraw his forces safely to a strong position three miles to the south on Malvern Hill, near the James River. Despite sensing signs of demoralization and collapse, Lee committed his troops to another day's battle the following morning. The Union artillery shattered wave after wave of Confederate infantry, prompting Confederate major general D. H. Hill to write later: "it was not war—it was murder." Following this overwhelming victory, McClellan completed his retreat from Richmond, moving first to Harrison's Landing on the James River, and then ultimately on to Washington, ending the Peninsula Campaign.