Early's expedition towards the Union capital was designed to take pressure off Robert E. Lee and the Army of Northern Virginia around Petersburg, Virginia. Beginning in early May, Ulysses S. Grant's Union army had continually attacked Lee and drove the Confederates into trenches around the Richmond-Petersburg area. In 1862, the Confederates faced a similar situation around Richmond, and they responded by sending General Thomas J. "Stonewall" Jackson to the Shenandoah Valley to occupy Federal forces. The ploy worked well, and Jackson kept three separate Union forces away from the Confederate capital.
Now, Lee sent Early on a similar mission. Early and his force of 14,000 marched down the Shenandoah Valley, crossed the Potomac into Maryland, and then veered southeast toward Washington. Union General Lew Wallace, commander of the Middle Department and stationed in Baltimore, patched together a force of 6,000 local militiamen and soldiers from various regiments to stall the Confederates while a division from Grant's army around Petersburg arrived to protect Washington.
Wallace placed his makeshift force along the Monocacy River near Frederick, Maryland. Early in the morning of July 9, Early's troops easily pushed a small Federal guard from Frederick before encountering the bulk of Wallace's force along the river. Wallace protected three bridges over the river. One led to Baltimore, the other to Washington, and the third carried the Baltimore and Ohio Railroad. Early's first attack was unsuccessful. A second assault, however, scattered the Yankees. The Union force retreated toward Baltimore, and the road to Washington was now open to Early and his army.
Union losses for the day stood at 1,800, and Early lost 700 of his men. However, the battle delayed Early's advance to Washington and allowed time for the Union to bring reinforcements from Grant's army.