During the Seven Days’ battles in 1862, George B. McClellan’s Army of the Potomac advanced to the outskirts of Richmond after landing at Fort Monroe and moving up the peninsula, threatening the Confederate capital. Robert E. Lee seized the initiative on June 26 by crossing the Chickahominy River with nearly 45,000 soldiers in a combined operation with Thomas J. “Stonewall” Jackson, opening a week-long campaign that drove the Union army back to the James River. That afternoon at Beaver Dam Creek, Lee’s attack against a well-positioned Federal force failed, but Jackson’s presence above the creek forced McClellan’s men to withdraw overnight. On June 27, McClellan began shifting to a new base on the James River as his rearguard at Gaines’ Mill barely escaped destruction in the second and largest battle of the Seven Days. On June 28, McClellan organized his retreat while Lee turned from protecting Richmond to pursuing and trying to defeat the Union army, and a Confederate probe at Gouldin’s Farm led to a small battle. On June 29, Lee attacked the Union rear at Savage’s Station on the Richmond & York River Railroad; the inconclusive fighting caused 1,400 casualties and briefly slowed the retreat. On June 30, Confederate columns pursued again, and at Glendale, or Frayser’s Farm, Lee came closest to success, but determined Union resistance kept the retreat route open. On July 1, McClellan’s army held a strong defensive position on Malvern Hill, where poorly coordinated Confederate attacks ended in a decisive Union victory. On July 2, the Confederates followed the Northern army to Harrison’s Landing, but Lee found no further offensive opportunity and ended the campaign that secured Richmond; afterward his army moved north, won at Cedar Mountain and Second Manassas, and began the first invasion of the North by marching toward Maryland.