During the Civil War, Union General George B. McClellan's forces gained possession of the greater part of the territory in the summer of 1861, culminating at the Battle of Rich Mountain, and Union control was never again seriously threatened. In 1863, General John D. Imboden, with 5,000 Confederates, raided a considerable portion of the state and burned Pierpont's library, although Willey escaped their grasp. Bands of guerrillas burned and plundered in some sections, and were not entirely suppressed until the war ended. The Eastern Panhandle counties were more affected by the war, with military control of the area repeatedly changing hands.