Cape Cod Railroad

The Cape Cod Railroad (also currently referred to as the Cape Main Line) is a railroad in southeastern Massachusetts, running from Pilgrim Junction in Middleborough across the Cape Cod Canal Railroad Bridge, where it splits towards Hyannis in one direction and Falmouth in the other. It was incorporated in 1846 as the Cape Cod Branch Railroad to provide a rail link from the Fall River Railroad line in Middleborough to Cape Cod.

Cape Cod Branch Railroad, 1846–1853
Among the proponents of the Cape Cod Branch Railroad were Col. Richard Borden of Fall River, who saw the new line as an opportunity to bring more traffic and business through his hometown. He was at one time president of the Bay State Steamboat Company, which together with the Old Colony Railroad formed the noted "Fall River Line". He was later elected president of the Cape Cod Railroad.

On January 26, 1848, the first 14.7 mi segment of the railroad was opened between Middleborough and Wareham. By May 1848 an additional 12.9 mi was opened to Sandwich, enabling unimpeded transit between Boston and Sandwich, thus serving the needs of the Boston & Sandwich Glass Company. In 1853, the extension of the line to Hyannis was started, reaching West Barnstable on December 22, 1853.

Cape Cod Railroad, 1854–1872
On February 22, 1854, the Cape Cod Branch Railroad was renamed the Cape Cod Railroad Company. In the spring of 1854, construction continued, with the railroad reaching Barnstable village May 8, Yarmouth Port May 19, and finally Hyannis on July 8, 1854. Connecting steamboat service to Nantucket commenced from Hyannis in late September and would continue until 1872.

Acquisitions
In 1868, the Cape Cod Railroad acquired the Cape Cod Central Railroad (1861–1868), which had opened a line from Yarmouth to Orleans in 1865.

In 1871, the Cape Cod Railroad bought the Plymouth and Vineyard Sound Railroad – which had been incorporated in 1861 as the Vineyard Sound Railroad Company intending to build a line from Buzzards Bay to Woods Hole. However, the road to Woods Hole was not completed until July 17, 1872, after the merger with the Cape Cod Railroad. Upon completion of that road, the steamboat service to Nantucket moved to Woods Hole.

Old Colony Railroad, 1872–1893
By this time, the Cape Cod Railroad had merged with the Old Colony and Newport Railway to form a new company, renamed the Old Colony Railroad. The Cape Cod routes became known as the "Cape Cod Division" of the Old Colony Railroad, with its headquarters in Hyannis. The merger was completed on September 30, 1872.The Woods Hole Branch opened on July 17, 1872.

With much fanfare, the Old Colony Railroad completed the line to Provincetown in July 1873. Old Colony Railroad maintained all rail operations on the Cape until their closure in 1893.

New York, New Haven and Hartford Railroad, 1893–1964
After Old Colony Railroad closed in 1893, the entire network was leased by New York, New Haven and Hartford Railroad, which took over operations on the Cape Cod Railroad. The NYNH&H ended daily passenger service to southeastern Massachusetts and the Cape in 1959. The railroad did, however, restore the popular seasonal rail service from New York City to Hyannis, with connections from Boston, during the 1960 through 1964 summer seasons.

The New Haven's passenger service to Cape Cod was operated under a number of different names, including and Day Cape Codder, the Night Cape Codder, the Neptune, the Islander, and the Flying Dude.

Amtrak, Bay Colony, and Cape Cod & Hyannis, 1980s–1990s
Following New York, New Haven and Hartford permanently terminating Cape operations in 1964, the Cape lacked any regular passenger rail service for almost twenty years. In 1984, the Cape Cod and Hyannis Railroad began providing seasonal service between Braintree and Hyannis, until their closure in 1988. In 1986, Amtrak began operating the Cape Codder during summer weekends from New York City to Hyannis, until it was terminated in 1996. The cancellation of the Cape Codder marked the end of non-heritage passenger rail between the Cape and the mainland for almost twenty more years.

From 1989 to 1999, Bay Colony Railroad operated seasonal heritage railroad excursions from Hyannis to Sagamore under the Cape Cod Railroad brand, until these services were taken over by Cape Cod Central Railroad in 1999. Bay Colony was also the sole operator of freight rail on the Cape from 1987 to 2007, until their contract expired and service was taken over by Massachusetts Coastal Railroad.

Present era
Throughout the 20th century, most of the railroad tracks on the outer Cape were removed, with many being replaced with rail trails. Today, the only railroad tracks on the Cape exist on the upper Cape. Shortly after crossing the Cape Cod Canal Railroad Bridge, the track splits in two directions, with one direction heading towards Falmouth and the other heading towards Hyannis. The Falmouth line is currently used for freight and heritage passenger service, while the Hyannis line is used for regular freight and passenger services.

Passenger service
The Cape Cod Central Railroad continues to operate seasonal tourist excursions, departing from Hyannis and Buzzards Bay and occasionally including stops at West Barnstable and Sandwich. A limited number of trains also depart from North Falmouth, which marks the only passenger service along the Falmouth spur of track.

Ever since the Old Colony Lines were restored for public service in the late 1990s, there have been several efforts made to extend commuter rail service from Middleborough/Lakeville station to Buzzards Bay. As of 2020, the MBTA is conducting a study to evaluate the feasibility of implementing such service in conjunction with the currently-underway South Coast Rail project. While regular commuter service has not yet been implemented, the seasonal passenger train CapeFLYER began operating from Boston to Hyannis in 2013, as a collaborative effort between Cape Cod Regional Transit Authority and Massachusetts Bay Transportation Authority. In addition to serving select stops along the regular commuter rail lines, the CapeFLYER also makes stops in Wareham, Buzzards Bay, Bourne, and Hyannis

Freight
In 2007, the contract for Cape freight rail was awarded to Massachusetts Coastal Railroad, which currently continues to manage all freight rail on the line today. The most common operation is the "energy train", which hauls refuse from the Upper Cape Regional Transfer Station in Falmouth and the Yarmouth-Barnstable Regional Transfer Station in Yarmouth, to the Southeastern Massachusetts Resource Recovery Facility, a waste-to-energy plant in Rochester. Other regular operations include interchanging with CSX in Middleborough and transporting material for the ongoing South Coast Rail project. Massachusetts Coastal Railroad is owned by the same parent company as Cape Cod Central Railroad.

Mass Coastal has been in conflict with proponents of a new rail trail that wish to replace the line between Bourne and Camp Edwards with a new branch of the Shining Sea Bikeway. This would eliminate rail service to the transfer station within Camp Edwards. The railroad is advocating for a rails with trails instead.