During June and July 1864, Confederate forces under the command of General
Jubal A. Early patrolled the Shenandoah Valley. Early's successes were a political liability for President
Abraham Lincoln, and caused Union leaders to divert resources away from Richmond and West Virginia. Union soldiers from the
Army of West Virginia began arriving via the
Baltimore and Ohio Railroad in
Martinsburg, West Virginia, on July 19, and had an initial success in the
Battle of Rutherford's Farm. A few days later, Early tricked Union General
George Crook into believing that Early had sent a large part of his Confederate force to Richmond. The result of this deception was a July 24
Confederate victory near
Winchester, Virginia, at the
Second Battle of Kernstown. Union troops, in some cases panic stricken, retreated to the north side of the
Potomac River. Early, who had threatened the federal capital of
Washington, D.C. during the first half of July, followed his Kernstown victory with an attack on northern territory. He dispatched two brigades of cavalry under General
John McCausland and General
Bradley Johnson to conduct raids in Pennsylvania.{{#tag:ref|McCausland was an alumnus of the
Virginia Military Institute, which had been burned by Union General
David Hunter during June 1864. Panic spread throughout the region as McCausland moved toward Chambersburg. The Union troops nearest to McCausland belonged to General William W. Averell, who was stationed in
Hagerstown, Maryland, and had troops guarding nearby
fords along the river. Averell had only 1,260 men and two pieces of artillery in his command. Averell's communications were cut around noon. After Early's
excursion north of
Washington a few weeks earlier, Averell was under pressure to make sure that Washington and Baltimore were not attacked. Averell's spies discovered Confederates moving east on the Baltimore Pike, and Averell mistakenly assumed they planned to attack
Baltimore. He cautiously positioned his force, which was under half the size of McCausland's, to protect Baltimore instead of moving directly to Chambersburg. The Confederate troops were merely a patrol that eventually retreated back to Chambersburg. This delayed Averell's arrival at Chambersburg, and allowed the Confederates to raid and burn Chambersburg virtually unopposed on July 30. Damage to the town was devastating—537 homes, businesses, and other structures were destroyed. This included all of the stores and hotels, two mills, two factories, and a brewery. After burning Chambersburg, McCausland moved west and rested his horses. Later that day, Averell arrived in Chambersburg, and then continued to pursue McCausland. His actions may have prevented the burning of
Hancock in Maryland, and
McConnellsburg and
Bedford in Pennsylvania. McCausland planned to burn Hancock, Maryland, after not receiving a ransom of $50,000 ($765,638 in 2016 dollars). This intensified a rift between McCausland and Johnson, who was from Maryland. Johnson denounced his commander, and ordered some of his men to town to protect its residents. The near-mutiny ended when Averell's cavalry approached. Averell's men skirmished with McCausland's rear guard. McCausland had been able to secure fresh horses, and escaped. Averell's horses were exhausted, and he was forced to pause in his pursuit of McCausland in Hancock. He could not secure fresh horses, since any in the area had already been taken by McCausland. Averell rested his troops until August 3, when he received an order from General David Hunter to pursue McCausland and attack "wherever found". With considerable difficulty, McCausland crossed the Potomac River and made camp near
Springfield, West Virginia, on the South Branch River. On the next day, they moved toward
Romney, and rested until August 4. On August 4, the Confederate cavalry continued with their second objective, which was disrupting the
Baltimore & Ohio Railroad. They attempted to raid New Creek (present day
Keyser, West Virginia). General Kelley sent a train load of reinforcements to defend New Creek, which had "well positioned" artillery but a small force. The reinforcements, artillery, and difficult terrain forced the Confederates to retreat south and abandon their raid. Johnson made his headquarters closer to his brigade at a mansion named
Willow Wall that was owned by the McNeill family. Each brigade had two pieces of artillery. Johnson kept several groups of pickets north of his camp along the main road. Averell's main force continued southward at 1:00am on August 7. The force was led by a group of scouts dressed in Confederate uniforms, while the main force followed far enough behind that they could not be detected. The scouts were led by Captain
Thomas R. Kerr of the 14th Pennsylvania Cavalry, and his men were selected specifically for this mission. While the scouts led the advance, the main body followed at a distance—and had to frequently stop while the scouts made sure it was safe for the main force to proceed. Many of the men would "lie down by the road side,
bridle rein in hand, [and] snatch a few minutes of sleep" while waiting for the scouts to signal it was OK to continue. At about 2:30am, Kerr's scouts deceived and captured a two-man
picket from Johnson's Brigade. From this action, the scouts learned the location of the next set of pickets—and quietly captured two more squads of rebels posted along the main road. ==Battle==