In the late summer of 1864, Maj. Gen. Phil Sheridan was given command of the Union Army of the Shenandoah by Grant, with orders to root out the remaining Southern resistance in the Valley and deny the Confederacy the benefit of the area's food and supplies. From late September to early October, Sheridan's men aggressively burned barns, mills, and crops that could be used to feed Rebel armies. The Confederate force in the valley, Gen. Jubal A. Early's Army of the Valley, had been unsuccessful in slowing Sheridan since the recent Union victories at Third Winchester, Fisher's Hill and Tom's Brook. By mid-October, Early was determined to strike Sheridan. The Confederate army was camped near Strasburg, and the Union men were in camps along the east bank of Cedar Creek. Early executed a surprise attack early on October 19, 1864 and drove first one, then another, then a third Union Corps from the field. As Early paused to reorganize, Sheridan arrived after a dramatic ride from his headquarters in Winchester just in time to rally his troops and launch a crushing counterattack, from which Early’s forces could not recover. Sheridan’s victory at Cedar Creek extinguished any hope of further Confederate offensives in the Shenandoah Valley, and was one of the Union victories in late 1864 that helped ensure President Abraham Lincoln's reelection that November.