One of the most beautiful Civil War sites, at Harpers Ferry, W.Va., commemorates an unsightly and chaotic battle that led to the capture of more than 12,000 Union soldiers and set the stage for the wholesale slaughter of rebels and federals at Antietam two days later.

Thomas Jefferson rhapsodized about the beauty of this slice of America, saying the view through the water gap in the Blue Ridge where the Potomac meets the Shenandoah was worth a voyage across the Atlantic. This is a place of complex geography, of rivers and mountains and mountain gaps that preoccupied the generals on both sides.

Robert E. Lee, taking the war across the Potomac into Maryland, assumed that the large Union garrison at Harpers Ferry would be withdrawn in an attempt to head off his advance. But the Union strategists ordered the garrison to stay put. That meant more than 10,000 federals remaining in Lee’s rear, potentially cutting off his supply line in the Shenandoah Valley.

He broke his army into five pieces and sent three to surround Harpers Ferry. The Union soldiers were green and not ready to fight.

“They were in wild confusion and dismay,” one Union lieutenant later testified about the initial battle for Maryland Heights, the mountain that overlooks Harpers Ferry from the northeast.

“Nobody had any command over them. They were worthless; not worth anything,” a Union captain reported.

From the west came Stonewall Jackson. He had the Union garrison surrounded. The federals took up position on Bolivar Heights, just up the hill from the village of Harpers Ferry. But they were sitting ducks. Jackson’s forces unleashed an artillery bombardment from seven locations. The noise was fearful.

“[T]he sight of orange-centered puffs of smoke on every side, the sound of explosions bouncing back and forth in the triple water gap, the feel of trembling earth, a handful of gruesome casualities, and a shortage of long-range artillery ammunition finished the garrison in an hour,” wrote Joseph L. Harsh in his book “Taken at the Flood: Robert E. Lee and the Confederate Strategy in the Maryland Campaign of 1862.”

The Union forces waved white flags. While the surrender was being sorted out, one of the final shells mortally wounded the Union commander, Gen. Dixon Miles.

Read the full Washington Post Civil War 150 series.

The three days of fighting at Harpers Ferry left 39 Confederates dead and 247 wounded, while the Union casualties totaled 44 killed, 173 wounded, and an astonishing 12,737 captured – the largest number of Union troops captured during the war.

Lee had vowed to retreat to Virginia and call off his Maryland campaign, but when he heard from Jackson on the morning of Sept. 15 that victory was at hand at Harpers Ferry, he changed his mind. He was at that point in Sharpsburg, near Antietam Creek.

“We will make our stand on these hills,” Lee declared.