The original rail line over Tehachapi Pass was constructed in the late 1870s, as part of Southern pacific’s route from San Francisco to El Paso and New Orleans. Originally intended to go by way of Cajon Pass, the line was diverted through Los Angeles at the request of influential Angelenos, taking the route down Soledad Canyon to get there, and then heading east from downtown LA, rejoining its originally-planned route at Colton. The line across the desert and over Cajon Pass would not be constructed until 1967.
The famous Tehachapi Loop was constructed as part of the engineering works required to keep the eastbound grade down to a manageable 2.2%, which also resulted in no less than horseshoe curves on the line. Seventeen tunnels were eventually constructed as part of the route between Bakersfield and Mojave. Many of these tunnels have since been removed, especially after the 1952 earthquake.
The line east from Mojave to Needles was also constructed by the Southern Pacific, in an effort to keep Santa Fe interests out of California. Eventually, this line was sold to the Santa Fe in return for Santa Fe’s line down the west coast of Mexico. When other Santa Fe interests constructed a line south through the San Joaquin Valley, they planned their own route across the mountains, but eventually settled for trackage rights over the SP between Kern Junction, in Bakersfield, and their own line at the south end of Mojave, in 1898.
Originally single track with passing places, in recent decades some segments of the line (including that through the town of Tehachapi) have been converted to double track, subsuming some of the existing siding in the process. Automatic block lower-quadrant semaphore signals were installed in 1905, replaced by searchlight signals and Centralized Traffic Control between Bena and Tehachapi in 1943.
Passenger trains of both railroads ran over the pass until Amtrak Day, May 1st, 1971, since when only occasional specials and detours have been run. SP freights originally ran from San Francisco to Los Angeles, and then onwards towards El Paso. Later, additional SP lines in the Stockton and Sacramento areas led to the SP freights originating and terminating at either Lathrop or Roseville. With the construction of the Colton-Palmdale cutoff in 1967, and SP’s new marshalling yard in West Colton in 1972, many SP freights over the pass moved their southern terminus to West Colton, and/or continued directly east from Colton.
Santa Fe freight traffic ran between Richmond and Stockton, to the north, and two routes diverging at Barstow, one to Los Angeles or San Diego, and the other heading east via Albuquerque or Amarillo. In the latter half of the 20th-centiry, Santa Fe joined with Western pacific and Great Northern (later Burlington Northern) to create a freight service between the pacific Northwest and Southern California, joining the Santa Fe at Stockton, in direct competition with SP (This service was curtailed after the Union pacific’s takeover of the WP in 1982.) The 1970s opening of the huge yard at Barstow led to many trains over the pass terminating there, with only the high priority and intermodal trains passing that location without reforming.
Santa Fe became part of BNSF Railway in 1995, and SP became part of an enlarged Union Pacific in 1996. With these mergers came new routing for some trains, including a direct connection for UP trains across the BNSF line (via trackage rights) to Daggett before taking the UP Salt Lake route north and east. The new BNSF quickly resumed the previous service between the Pacific Northwest and Southern California, in competition with UP’s newly-named I-5 Corridor.