Railroads were essential to the growth of Cañon City, bringing people and materials into the region, carrying local products to market, and most importantly supporting mining. Between 1877 and 1880, the Denver and Rio Grande and the Atchison, Topeka and Santa Fe Railroads fought bitterly for the right to lay track through the Royal Gorge to reach Leadville, with the Royal Gorge Route Railroad War involving lawsuits, injunctions, armed guards, hired gunfighters including Bat Masterson and Doc Holiday, sabotage, and attacks on trains, depots, and facilities before the Denver and Rio Grande prevailed in court. In 1874, the Denver and Rio Grande extended its line into Cañon City and stopped there, but after silver and lead were discovered near Leadville in 1877, Cañon City became the rail hub of the region as trains carried miners, machinery, food, and supplies into the mountains and returned with ores and minerals, while rail lines linked mines, quarries, and oil fields to mills, smelters, refineries, and markets. In the 1890s, four transcontinental passenger trains passed through the Royal Gorge enroute to Salt Lake City every day, making the gorge a major transportation corridor, and the influx of travelers and tourists led to the construction of the Royal Gorge Bridge as a tourist attraction. Passenger train service ended in 1967 after alternate mountain rail lines were built, then resumed in 1999 when the Royal Gorge Route began carrying sightseers into the gorge and to the bridge. Another major force in the local economy began in 1871, six years before Colorado became a state, when the Territorial Prison, known as Old Max, opened with three inmates. Correctional facilities became an integral part of Fremont County's economy, and from 1905-06 inmates built Skyline Drive west of the city to support tourism, also constructing Tunnel Drive and working in the brickyards, quarrying, and canning industries.