After defeating the Federal forces in the Shenandoah Valley at the Second Battle of Kersntown, Jubal Early sent his cavalry north again to raid the towns of Maryland. The troopers under the command of Brigadier General John McCausland crossed the Potomac river on July 29th. After them was a force of Union cavalry under General William Averell. Averell positioned his men to block an attack towards Baltimore, but in the mean time the rebels captured and burned Chambersburg. McCausland then headed the other direction, into West Virginia. They attempted to cut the B&O Railroad, but were driven off by the Union garrison. When Averell received word of the Confederates' movements, he set off after them determined that they would not escape his grasp.
The Federals were badly outnumbered, with 1,760 troopers to about 3,000 Confederates, so they made a night attack. They charged into one of the two Confederate camps around 3 am. The Confederates were surprised to be awoken in the middle of the night, and those who did not flee were quickly taken prisoner. However, the commotion awakened the other camp, and they fell into line to meet the raid. Averell had already anticipated this, so at that moment they were struck on both flanks by parties of Federals. The Confederate line crumbled, and the Federals followed in hot pursuit. The Confederates lost 13 killed, 60 wounded and 415 captured. The Federals had 11 killed, 18 wounded and 13 captured.