In the summer of 1862, while Gen. Robert E. Lee engaged the Army of the Potomac outside Richmond, Union Gen. John Pope organized the Army of Virginia near Warrenton and aimed his offensive toward the railroad hub at Gordonsville. To block that movement, Lee assigned Gen. Thomas J. "Stonewall" Jackson and 24,000 men to defend the town. Gen. Nathaniel P. Banks, leading the vanguard of Pope's army, entered Culpeper County on August 7, and Jackson moved to strike him before the rest of the Union force could concentrate. On August 9, after both armies marched hard in the heat to reach the field, Jackson encountered Banks's men drawn up near the Culpeper Road. As Jackson's column approached in a strung-out formation, Banks ordered an attack that nearly routed the Confederates. Jackson rallied his men under heavy fire, and the arrival of Gen. A.P. Hill's division reversed the battle. The Confederate counterattack crushed Banks's force, halted the Union advance on Gordonsville, and helped set the stage for the Southern victory at Second Manassas three weeks later.