Hundreds of miles away, Union soldiers under the command of Ulysses S. Grant were closing in on Vicksburg, Mississippi, a crucial point on the Mississippi River. If Vicksburg should fall, Union forces would have complete control of the Mississippi, effectively cutting the Confederacy in two. Lee knew that no matter what he did in the East, he likely could not help Vicksburg directly. Thus, he had to act quickly to offset Vicksburg's possible surrender. The Confederate general decided to repeat his strategy from the previous September, when he had invaded Maryland in an attempt to strike a war-winning blow. Lee decided it was time for his second excursion north of the Potomac River.
Lee began moving his army north in early June 1863. On June 9, while near Culpepper, Virginia, Confederate cavalry forces under Major General Jeb Stuart became engaged with Federal cavalry in the Battle of Brandy Station, the largest cavalry battle of the Civil War. By mid-June, Lee's army was north of the Potomac and headed toward Pennsylvania.
While Lee's army moved northward, the Army of the Potomac was struggling with the aftermath of defeat. Joseph Hooker was still in charge of the army, but the Lincoln Administration in Washington had little confidence in him. While Hooker moved north, he and General-in-Chief Henry Halleck argued over the status of Union troops stationed at Harpers Ferry. The dispute ultimately led Hooker to submit his resignation, which Halleck and Lincoln accepted.
On June 28, Major General George Gordon Meade took command of the Army of the Potomac. At this point, Lee's army was already in Pennsylvania, and Union forces were in Maryland moving north as quickly as possible.