The Keystone Subdivision is a railroad line owned and operated by CSX Transportation in the U.S. states of Maryland and Pennsylvania. The line runs from Cumberland, Maryland west to Connellsville, Pennsylvania (near Pittsburgh) along a former Baltimore and Ohio Railroad (B&O) line. The line includes the well-known Sand Patch Grade over the Allegheny Mountains.
The east end of the Keystone Subdivision is at Viaduct Junction in Cumberland, where it meets the Cumberland Terminal Subdivision at the east end of the Cumberland Viaduct. The west end is at Connellsville; the Pittsburgh Subdivision continues to and past Pittsburgh. The Keystone Subdivision also joins with the S&C Subdivision at Rockwood, Pennsylvania.
The Baltimore and Ohio Railroad initially wanted to build to Pittsburgh, but the Pennsylvania legislature refused to grant it a charter, preferring that goods travel from Pittsburgh over the Main Line of Public Works to Philadelphia.
The Pittsburgh and Connellsville Railroad (P&C) was first incorporated in 1837, but did not succeed in raising money until 1846. Work began in 1847, and the line opened from Pittsburgh to Connellsville in 1857 and to Cumberland in 1871. The B&O leased the P&C for 50 years effective January 1, 1876, and it was merged into the B&O in 1912.
In summer 1985, the Chessie System (the B&O's holding company at the time) announced that it would sever its St. Louis line through Ohio, rerouting all through traffic over the Alleghenies at Sand Patch rather than along the older Mountain Subdivision.