The Federal garrison inside Harpers Ferry was vulnerable to a Confederate attack after Lee's invasion of Maryland in September. The strategic town on the Potomac River was cut off from the rest of the Union army. General George B. McClellan, commander of the Army of the Potomac, sent messages to Union General Dixon Miles, commander of the Harpers Ferry garrison, to hold the town at all costs. McClellan promised to send help, but he had to deal with the rest of the Confederate army.
Jackson rolled his artillery into place and began to shell the town on September 14. The Yankees were short on ammunition, and Miles offered little resistance before agreeing to surrender on the morning of September 15. As Miles' aid, General Julius White, rode to Jackson to negotiate surrender terms, one Confederate cannon continued to fire. Miles was mortally wounded by the last shot fired at Harpers Ferry.
The Yankees surrendered 73 artillery pieces, 13,000 rifles, and some 12,000 men at Harpers Ferry. It was the largest single Union surrender of the war.
The fall of Harpers Ferry convinced Lee to change his plans. After suffering heavy losses on September 14 in Maryland at the Battle of South Mountain, to the northeast of Harpers Ferry, Lee had intended to gather his scattered troops and return to Virginia. Now, with Harpers Ferry secure, he summoned Jackson to join the rest of his force around Sharpsburg, Maryland. Two days later, on September 17, Lee and McClellan fought the Battle of Antietam.