The Richmond, Fredericksburg, and Potomac Railroad (RF&P) was a strategically important rail line linking thenear the United States capital at Washington, D.C., and the Confederate capital at during the (1861–1865). Incorporated in 1834, the railroad was seized by Confederates after in April 1861, but struggled to maintain its lines under the increased traffic of men and matèriel. The Union army captured a portion of the railroad at Aquia Creek, and engineers led by Herman Haupt engaged in sometimes astonishing feats of engineering—laying three miles of track in three days, for instance, and constructing a 400-foot-long bridge in nine days. Throughout the war, portions of the railroad were destroyed and rebuilt, and Confederates found it increasingly difficult to keep up with repairs for lack of equipment and labor. By the end of the war, its lines were almost completely unusable, but within two months of ‘s at Appomattox Court House, service between Richmond and Hamilton’s Crossing in Spotsylvania County was restored.