After stunning victories at Fredericksburg and Chancellorsville, Virginia, early in May 1863, Confederate Gen. Robert E. Lee carried the war through Maryland, across the Mason and Dixon Line and into Pennsylvania. His infantry marched north through the Shenandoah Valley and western Maryland as his cavalry, led by Gen. J.E.B. Stuart, harassed Union supply lines to the east. Union Gen. Joseph Hooker, replaced on June 28 by Gen. George G. Meade, led the Army of the Potomac from the Washington defenses in pursuit. The Federals collided with Lee’s Army of Northern Virginia at Gettysburg, Pennsylvania, on July 1, starting a battle neither side had intended to fight there. Three days later, the defeated Confederates began retreating through Maryland, retracing their steps to the Potomac River and crossing on July 14 into what only a month earlier had been Virginia. On June 20, after Lee crossed the river heading north, the Union had admitted West Virginia—the only state to secede from a seceded state.