The Rhondda and Swansea Bay Railway was a Welsh railway company formed to connect the upper end of the Rhondda Fawr with Swansea, with the chief objective of transporting coal and other minerals to Swansea docks. It was incorporated in 1882, but at first the connection to Swansea from Briton Ferry was refused.
The construction required the formation of the Rhondda Tunnel, nearly two miles (3.2 km) long through difficult geological conditions, but the line opened from Treherbert through the tunnel to Port Talbot and Aberavon in 1890. Authorisation to extend to Swansea, and also Neath, was secured and those lines opened in 1894 (goods) and 1895.
The line suffered operational challenges and was never greatly profitable, but it arranged for the Great Western Railway to operate the line and guarantee good dividends from 1906. The GWR incorporated the line's infrastructure in widening its own lines at Court Sart and at Swansea docks. As it was heavily dependent on coal mining activity, the line declined sharply after 1945, and it was progressively truncated. The Rhondda Tunnel suffered a collapse in 1968 and the upper part of the line closed. A short section of the original route is in use near Briton Ferry and in the Swansea docks complex.