Brookeville is notable as the "United States Capital for a Day" during the War of 1812, when British troops burned Washington D.C., and President James Madison sought refuge in Brookeville on August 26, 1814. During the American Civil War, Brookeville, along with nearby Sandy Spring, was a stop on the Underground Railroad.