On August 26, Maj. Gen. Stonewall Jackson led his corps of the Army of Northern Virginia through Thoroughfare Gap, on his way to raiding the Union supply depot at the Manassas Junction. In response to the raid, the following day Union Maj. Gen. Irwin McDowell set out from Warrenton to Manassas Junction to engage Jackson. In order to protect his army's left flank, he dispatched Brig. Gen. James B. Ricketts's brigade and the 1st New Jersey Cavalry under Sir Percy Wyndham towards the Gap. Ricketts stopped at Gainesville, to the east, while Wyndham occupied the gap. Maj. Gen. James Longstreet's corps, meanwhile, followed in the path of Jackson's march and was approaching the gap from the west late on the evening of August 27.