In the East, during this period, Federal operations were directed by Maj. Gen. Joseph Hooker, who replaced Burnside as commander of the Army of the Potomac on 25 January. Hooker effected some reorganization and by late April was ready to assume the offensive with about 134,000 men. Hooker's objective was to destroy Lee's army, about 60,000 strong, which was still holding Fredericksburg. To accomplish this he planned a double envelopment which could place strong Union forces on each of Lee's flanks. The Chancellorsville Campaign began, as planned, with the movement of five corps under Hooker up the Rappahannock and across the river to Chancellorsville, while two corps under Maj. Gen. John Sedgwick crossed below Fredericksburg. Meanwhile Union cavalry made a diversionary raid in Lee's rear.
Lee quickly became aware of Hooker 's intentions, and on 1 May boldly launched an attack toward Chancellorsville, leaving on a small force to defend Fredericksburg. In a brilliant display of generalship, Lee outflanked Hooker's force and kept it on the defensive. He also repulsed Sedgwick, who had taken Fredericksburg on 3 May and had advanced west, only to be driven northward across the Rappahannock on 5 May. Lee then turned his full attention to Chancellorsville, but Hooker withdrew his forces across the Rappahannock on 6 May before the Confederates could launch an assault. Federal casualties were 1,575 killed, 9,594 wounded, and 5,676 missing; Confederate casualties were 1,665 killed, 9,081 wounded, and 2,018 missing. Among the Confederate losses was Stonewall Jackson, who was mortally wounded on 2 May.
Encouraged by the victory at Chancellorsville, Confederate authorities decided to attempt another invasion of the North. In early June Lee began moving his unite up the Shenandoah and Cumber1and Valleys into Pennsylvania, where he was forced by the exigencies of scanty supply to disperse his army over a broad area. Hooker had become aware of Lee's intentions by mid-June, and had promptly started north with his army, crossing the Potomac near Leesburg on 25-26 June. When Lee learned of this he ordered his army to concentrate at once between Cashtown and Gettysburg.