The Loudoun Rangers were formed in the spring of 1862, when the Union Army first occupied Loudoun County as part of its campaign in the Shenandoah Valley. Returning with the army was local unionist Samuel Means, who had been run out of the county the previous year by local Confederates. Secretary of WarEdwin M. Stanton issued Means orders to raise a company of men to serve as an independent command, of which he would be captain, for special service in Loudoun and along the Virginia-Maryland border. Recruiting operations were established in the northern Loudoun Valley, an area of strong unionist sentiment, eventually leading to the formation of 2 companies. For the first two years of service the Loudoun Rangers served as partisans, often in conjunction with Cole's Maryland Cavalry (1st Potomac Home Brigade) fighting their confederate counterparts, such as White's Comanches, Mosby's Rangers and John Mobberly's renegade band in and around Loudoun. In 1864 the Rangers were absorbed into regular service, leading to Means' departure. Daniel Keyes subsequently took his place as leader of the outfit. During the final years of the war the Rangers were attached to the Union army in the Shenandoah Valley and took part in the Valley Campaigns of 1864 under General Phillip Sheridan. As the war in the valley came to an end, the Rangers returned to their partisan role and were eventually effectively broken up in April 1865 when a detachment of Mosby's Rangers raided their camp at Castleman's Ferry and captured the better part of the command. The Rangers were officially mustered out of service the following month.