In early June, General Robert E. Lee's Army of Northern Virginia began an invasion of the North. Lee's men pulled out of defenses along the Rappahannock River and swung north and west into the Shenandoah Valley. Using the Blue Ridge Mountains as a screen, the Confederates worked their way northward with little opposition. General Joseph Hooker, commander of the Army of the Potomac, was unsure of the Confederates' intentions. He tracked Lee's army from a distance, staying safely away to protect Washington, D.C.
During this time, Winchester was in Union hands. The city was literally at the crossroads of the war, so it changed hands continually. Robert Milroy, the commander of the Yankees in Winchester, was unaware that the vanguard of Lee's army was heading his way. He had received some warnings from Washington, but an order to evacuate Winchester did not reach him because the Confederates had cut the telegraph lines. As late as June 11, Milroy bragged that he could hold the town against any Confederate force. His assertion was rendered ridiculous when Richard Ewell's Rebel corps crashed down on his tiny garrison.
Ewell's force quickly surrounded the Yankees. After a sharp battle, Ewell captured about 4,000 Federals, while Milroy and 2,700 soldiers escaped to safety. Ewell lost just 270 men but captured 300 wagons, hundreds of horses, and 23 artillery pieces. Milroy was relieved of his command and later arrested, although a court of inquiry found that he was not culpable in the disaster.