Following those battles in the fall of 1864, the majority of the Army of the Shenandoah was detached to Grant at Petersburg and to William Tecumseh Sherman in Georgia. Sheridan joined Grant for the Appomattox campaign where Sheridan commanded the Army of the Shenandoah, which included two divisions of cavalry commanded by Wesley Merritt. In late April 1865, command of the army then passed to Brig. Gen. A. T. A. Torbert until July 12, 1865, when the force was disbanded for the final time.