The Main Line of the Pennsylvania Railroad was a rail line in the U.S. state of Pennsylvania, connecting Philadelphia with Pittsburgh via Harrisburg. It is still an important cross-state corridor, composed of Amtrak's Philadelphia to Harrisburg Main Line, SEPTA's R5 Line and the Norfolk Southern Railway's Pittsburgh Line.
The Harrisburg, Portsmouth, Mountjoy and Lancaster Rail-Road opened from Harrisburg southeast to Middletown and from Lancaster northwest to Rheems in 1836. The next year the piece from Middletown to Elizabethtown opened, and the line was completed in 1838 with the opening of the Elizabethtown Tunnel.
The Pennsylvania Railroad Company was chartered by the Pennsylvania legislature on April 13, 1846. Construction began in 1847 and the first section opened from Harrisburg west to Lewistown on September 1, 1849 (including the original Rockville Bridge across the Susquehanna River). Further extensions opened to McVeytown on December 24, Mount Union on April 1, 1850, Huntingdon on June 10, and Duncansville (west of Hollidaysburg) on September 16, 1850, taking it to a connection with the Allegheny Portage Railroad on the east side of the Allegheny Ridge. On the other side of the ridge, the main line opened from Conemaugh (on the Portage Railroad east of Johnstown) west to Lockport on August 25, 1851. On December 10, 1851, sections opened from Lockport west to Beatty (west of Latrobe) and from Pittsburgh east to Brinton, with a temporary stagecoach transfer between via the Southern Turnpike and a short turnpike branch built to Beatty. Part of that gap was filled on July 15, 1852, from Brinton east to Radebaugh, and on November 29 the full line was completed, forming the first all-rail route between Philadelphia and Pittsburgh, though still using seven of the original ten planes of the Allegheny Portage Railroad.
Plane Number 1 of the Portage Railroad was bypassed by the PRR on April 1, 1852. Other planes began to be bypassed by the New Portage Railroad, completed in 1856, but on February 15, 1854 the PRR's new line opened, leaving the old one on the east side of the ridge in Altoona and running west via the Horseshoe Curve and Gallitzin Tunnel, only using a short portion of the old Portage Railroad near South Fork and a longer adjacent section of New Portage Railroad. A reciprocal trackage rights agreement made March 18, 1854, allowed the PRR to use that section for free.
On March 21, 1849, the PRR contracted with Eagle Line, primarily a steamboat company, for through service over the Philadelphia and Columbia Railroad. The PRR obtained trackage rights over the Harrisburg, Portsmouth, Mountjoy and Lancaster Rail-Road, opened in 1838, on April 21, providing a route from Harrisburg to the Philadelphia and Columbia at Dillerville, just west of Lancaster. On September 1, the first section of the PRR opened, with all arrangements in place for service from Philadelphia to Lewistown.
In 1853, the PRR surveyed the Lancaster, Lebanon and Pine Grove Railroad from Philadelphia west via Phoenixville to Salunga on the Portsmouth, Mount Joy and Lancaster Railroad. This was done in order to show the state that the PRR was willing to build its own alignment around the Philadelphia and Columbia. On August 1, 1857, the PRR bought the whole Main Line of Public Works. The Philadelphia and Columbia Railroad was integrated into its system. Most of the New Portage Railroad, just completed the previous year at a cost of $2.14 million, was abandoned, while short sections became local branches. The canals were abandoned, and short sections were filled and covered by rails. On January 1, 1861, the PRR leased the HPMJ&L, giving it full control of its main line.