The Baltimore and Ohio Railroad is one of the oldest railroads in the United States and the first common carrier railroad. It came into being mostly because the city of Baltimore wanted to compete with the newly constructed Erie Canal (which served New York City) and another proposed canal which would have connected Philadelphia and Pittsburgh. At first the B&O was located entirely in the state of Maryland with an original line from Baltimore west to Sandy Hook. At this point to continue westward, it had to cross into Virginia (now West Virginia) over the Potomac River, adjacent to the confluence of the Potomac and Shenandoah rivers. From there it passed through Virginia from Harpers Ferryto a point just west of the junction of Patterson Creek and the North Branch Potomac River where it crossed back into Maryland to reach Cumberland. From there it was extended to the Ohio River at Wheeling and a few years later also to Parkersburg, West Virginia.

More Info: en.wikipedia.org