In the first year of the Civil War, Hunter occupied several positions. He fought at First Manassas as a division commander. He transferred to temporary command of the Department of the West to earn his rank as major general, until it was dismantled, resulting in his removal to command of the Department of Kansas. In March 1862, he was put in charge of the Department of the South. He was charged with the investigation into the surrender at Harpers' Ferry, and at Fitz-John Porter's court-martial. He was removed from command after a failed attempt to take Charleston. Grant put him in charge of the Army of the Shenandoah during the 1864 Campaign for his success at Piedmont. Following his success, he pursued his enemy toward Lynchburg before his defeat at Liberty called for his retreat into West Virginia. He was replaced by Sheridan in August 1864. He mustered out in 1866. In July 1866, he was promoted to major general.