The Manassas Gap Railroad (MGRR) ran from Mount Jackson, Virginia, to the Orange and Alexandria Railroad's Manassas Junction, which later became the city of Manassas, Virginia. Chartered by the Virginia General Assembly in 1850, it was used to move Confederate troops and to raid the Baltimore and Ohio Railroad during the American Civil War.
With Edward Carrington Marshall as president and financial assistance from the Virginia Board of Public Works, construction was started westward in 1851 from a junction with the Orange and Alexandria Railroad (O&A) at Tudor Hall in Prince William County (a location the railroads called Manassas Junction). The tracks ran toward Front Royal and through Manassas Gap in the Blue Ridge Mountains to the Shenandoah Valley. It was completed to Strasburg in 1854. Building south up the Shenandoah Valley, the railroad reached Mount Jackson in Shenandoah County in 1859.
The original plan included a branch through Loudoun County to connect to Harpers Ferry and the Baltimore and Ohio Railroad. Financial troubles and the American Civil War scuttled those plans. Similarly, efforts began in 1854 on the "Independent Line," 35 miles of track from Alexandria to Gainesville intended to bypass the O&A. The way was graded but never completed because of financial difficulties and the Civil War. In 1867, the Manassas Gap Railroad merged with the O&A, rendering the unfinished line redundant. Today, several portions of the abandoned roadbed remain in Fairfax County.