Loudoun served initially as an outpost of the Confederate army based out of Winchester. From the garrison at Leesburg, the Confederates conducted raids and recruitment drives into central Maryland, carting away men and supplies, as well as threatening the C&amp;O Canal, B&amp;O Railroad and Washington. To meet this threat, Federals deployed along the Loudoun-Maryland border, leading to many skirmishes at the strategic river crossings. Later, after that post was abandoned, Loudoun served as point of crossing between the Piedmont and the Shenandoah Valley, as well as between Virginia and Maryland. All of the Army of Northern Virginia passed through the county on its way to Antietam, while the Army of the Potomac crossed the county on its way back from that battle. Again in 1863 the Army of the Potomac used Loudoun to get to and return from Gettysburg. Finally, in 1864, Jubal Early and his Federal pursuers used Loudoun to pass from the D.C. environs to the Shenandoah Valley after the Battle of Fort Stevens. In all, the county changed hands six during the course of the war, and the passing of the armies led to many small conflicts in the county.