By 1859, Chambersburg and its active community of free and enslaved blacks and sympathetic whites was a stop on the Underground Railroad. Several schools taught black children, although such was illegal in Virginia and slave states further south. John Brown stayed in an upstairs room at Mary Ritner's boarding house between June and October, 1859 while preparing for his raid on Harpers Ferry (then in Virginia). Several of his fellow raiders stayed in the house as well, and four of them escaped capture and briefly visited the house after the raid. The house still stands at 225 East King Street. While in Chambersburg, Brown posed as Dr. Isaac Smith, an iron mine developer, and bought, shipped and stored weapons under the guise of mining equipment.
Brown (using the name John Smith) and John Henry Kagi met with Frederick Douglass and Shields Green at an abandoned quarry outside of town to discuss the raid on August 19. According to Douglass's account, Brown described the planned raid in detail and Douglass advised him against it. Douglass also provided $10 from a supporter, and had helped Green – a future raider – locate Brown.
During the American Civil War on October 10, 1862, Confederate Maj. Gen. J.E.B. Stuart, with 1,800 cavalrymen, raided Chambersburg, destroying $250,000 of railroad property and taking 500 guns, hundreds of horses, and at least "eight young colored men and boys."They failed, however, to accomplish one of the main targets of the raid: to burn the railroad bridge across the Conococheague Creek at Scotland, five miles (8 km) north of town.
During the early days of the 1863 Gettysburg Campaign, a Virginia cavalry brigade under Brig. Gen. Albert G. Jenkins occupied the town and burned several warehouses and Cumberland Valley Railroad structures and the bridge at Scotland. From June 24–28, 1863, much of the Army of Northern Virginia passed through Chambersburg en route to Carlisle and Gettysburg, and Robert E. Lee established his headquarters at a nearby farm.
The following year, Chambersburg was invaded for a third time, as cavalry, dispatched from the Shenandoah Valley by Jubal Early, arrived. On July 30, 1864, a large portion of the town was burned down by Brig. Gen. John McCausland for failing to provide a ransom of $500,000 in U.S. currency, or $100,000 in gold, although the local bank had sent its reserves out of town for safekeeping. Among the few buildings left standing was the Masonic Temple, which had been guarded under orders by a Confederate mason. Norland, the home of Republican politician and editor Alexander McClure, was burned even though it was well north of the main fire.
One black Chambersburg resident was killed when Confederates refused to allow him to leave his burning house. Another man was asked by the Confederates if he had ever educated "nigg@rs"; after replying that he had, the Confederates burned his house as well. Subsequently, "Remember Chambersburg" soon became a Union battle cry.
Confederate Lieutenant General Jubal Early was accused of war crimes for ordering Chambersburg burned. The actual burning divided two of his cavalry commanders, because when Maryland-born Gen. Joseph "Allegheny" Johnson saw the behavior of Gen. McCausland's troops in Chambersburg, he refused to participate in a similar burning at Cumberland and Hancock, Maryland not far to the south, so both those towns survived despite likewise not paying ransoms. Union cavalry under Brig. Gen. William W. Averill, although initially misdirected toward Baltimore and thus late to arrive to prevent the atrocities, also pursued the Confederates, who sustained several defeats and lost most of the Shenandoah Valley by November. Furthermore, when the Army of Northern Virginia surrendered on April 9, 1865, Early escaped to Texas by horseback, where he hoped to find a Confederate force still holding out. He proceeded to Mexico, and from there, sailed to Cuba and Canada. Living in Toronto, he wrote his memoir, A Memoir of the Last Year of the War for Independence, in the Confederate States of America, which focused on his Valley Campaign and was published in 1867.
A combination of state and private funding rebuilt Chambersburg. However, many new buildings were erected quickly and not initially built to the original standards. It took more than 30 years to fully restore the town's housing stock to pre-Civil War standards. As discussed further below, Chambersburg was the site of one of the 69 schools established by Pennsylvania to educate children orphaned by the war, and which remained when all other such were closed decades later. Known as "The Scotland School for Veterans Children" after the 1890s, it remained open until 2010 and graduated more than 10,000 children during its lifetime.
Since people from Chambersburg had relatives on both sides during the war, and the war devastated the town, the town event also became a part of the town's identity. On July 17, 1878, 15,000 people attended dedication of Memorial Fountain in the town's center, which honors the Civil War soldiers, and later Chambersburg's fighters in other wars. A statue of a Union soldier stands next to the fountain, facing south to guard against the return of southern raiders.
To this day, the Civil War burning of Chambersburg remains a part of the town's historic identity and yearly memorial events are held, especially near July 30.
Chambersburg has also recently been the subject of study on how people have historically perceived and responded to war tragedies.