Less than two weeks after the start of the Gettysburg Campaign, Maj. Gen. J.E.B. Stuart’s cavalry screened the Confederate infantry as it marched north behind the sheltering Blue Ridge Mountains. Stuart established his headquarters at Middleburg, on the Ashby's Gap Turnpike just east of the Blue Ridge, and scattered his brigades throughout the Loudoun Valley to monitor Union activity. Stuart's counterpart, the Federal cavalry commander, Maj. Gen. Alfred Pleasanton, had orders to penetrate Stuart's screen and locate the Confederate infantry. On June 17th, Pleasanton sent forward the 1st Rhode Island Cavalry under the command of Col. Alfred Duffié to Middelburg. Unsupported, Duffié's regiment pushed aside Rebel skirmishers and entered town, but was then overpowered there by the brigade of Brig. Gen. Beverly Robertson. The 1st Rhode Island was routed, taking about 225 casualties. On June 19th, after the engagement at Aldie five miles to the east, Stuart had pulled back toward the Blue Ridge. The brigade of Col. J. Irvin Gregg’s advanced, driving Robertson’s cavalry to high ground one mile beyond Middleburg. Both sides were reinforced and mounted and dismounted skirmishing continued. The Yankee troopers forced Stuart's men out of their position but the Rebel cavalry fell back again toward Upperville, still covering the approaches to the Blue Ridge.