Following the Federal retreat back from Lynchburg in June 1864, Confederate General Jubal Early led his Army of the Valley north and crossed the Potomac River into Maryland, threatening Washington D.C. to the east. On July 9, the Confederates were met at Monocacy by Union troops under General Lew Wallace. Early won the battle, and continued his march onto Washington. Wallace’s engagement of the Confederate troops at Monocacy delayed their advance long enough for reinforcements to march from Petersburg to Washington, DC. The influx of Union men from the south contributed to Early’s defeat at the Battle of Fort Stevens, located on the Washington-Maryland boarder, forcing him to retreat to Virginia. Thus, the Union delaying tactic at Monocacy became known as the “Battle That Saved Washington.”
Union troops under General Horatio Wright joined with those of General George Crook, who had taken over the command from General David Hunter. The Federals pursued Early and engaged a Confederate force under General John B. Gordon on the Shenandoah River in the Battle of Cool Springs on July 17 and 18.
Early appeared to retreat southward, however instead he attacked and defeated Crook on July 23 in the Second Battle of Kernstown, and sent a raiding party north into Chambersburg, Pennsylvania. On July 30, Confederates demanded ransom for property destroyed in the Shenandoah Valley, and upon not receiving payment, the Southern troops burned a significant portion of Chambersburg. On August 5, 1864, General-in-Chief Ulysses S. Grant directed General Philip Sheridan to take Federal troops into the Valley to destroy Early, commencing the Shenandoah Campaign.