The Baltimore and Ohio Railroad—the B&O—is the oldest railroad in the United States. Its first section was opened in 1830 and came into being mostly because the city of Baltimore wanted to compete with the newly constructed Erie Canal, which served New York City.