The campaign was effectively concluded at the Battle of Cedar Creek (October 19, 1864). In a brilliant surprise attack at dawn, Early routed two-thirds of the Union army, but his troops were hungry and exhausted and many fell out of their ranks to pillage the Union camp; Sheridan managed to rally his troops and defeat Early decisively. In late fall, Sheridan sent his infantry to assist Grant at Petersburg, with his cavalry arriving the following spring. Most of the men of Early's corps rejoined Lee at Petersburg in December, while Early remained to command a skeleton force until he was relieved of command in March 1865 after his defeat at the Battle of Waynesboro, Virginia.