The Swansea Vale Railway (SVR) was a railway line connecting the port of Swansea in South Wales to industries and coalfields in the Swansea Valley and the Brynamman district on the borders of Glamorgan and Carmarthenshire. Later additions to the route included a loop line through Morriston and a branch – the Swansea Vale and Neath and Brecon Junction Railway – which connected the SVR to the system of the Midland Railway Company by means of running powers over the Neath and Brecon Railway. The Midland and its successor company the London, Midland and Scottish Railway were the owners of the SVR from 1876 until 1947.
First opened in 1816 as a tramroad for conveying coal from Scott's Pit, near Birchgrove, to wharves on the River Tawe nearly four miles (6 km) to the south, the Swansea Vale route grew to become a feeder railway for several mines and metal-working industries in the valley, and by 1874 it was carrying passengers between Swansea St Thomas station, Llansamlet, Glais, Pontardawe, Ystradgynlais (on the Swansea Vale and Neath and Brecon Junction Railway), Ystalyfera, and Brynamman. The railway was leased in 1874 by the Midland Railway and purchased outright by that company two years later in order to give the Midland access to Swansea docks bypassing the routes of rival railway companies.
In 1923, most of Britain's railways were merged into the "Big Four" companies and the Midland Railway (and thus the Swansea Vale Railway) became part of the London Midland & Scottish Railway (LMS), which also served Swansea over the Central Wales line into Victoria station, on the opposite side of the river Tawe. In 1930 the LMS concluded a traffic pooling agreement with the Great Western Railway, which owned most of the railways in and around Swansea, under which the direct passenger service over the Swansea Vale line between St Thomas station, Brecon and Hereford was withdrawn at the end of that year. Passenger services between Swansea and Brynamman over the Swansea Vale route remained, however, until further rationalisation following railway Nationalisation in 1948 resulted in their withdrawal on and from 25 September 1950. The route via Morriston and Clydach was severed at this time, but freight traffic (principally coal) on the rest of the system remained buoyant into the 1960s when it was run down as collieries and other industries in the valley closed. Freight services from Swansea to Pontardawe were withdrawn in 1964, but the southern end of the line, from Swansea (Eastern Depot) to Six Pit Junction and to Morriston remained into the 1970s, serving the Rio Tinto Zinc Swansea Vale smelting works at Llansamlet and Bird's and Cohen's scrapyards at Morriston. The very last train over this section of the line was a special working conveying rolling stock for the nascent Swansea Vale Railway Society to the Society's depot at Six Pit on 8 February 1983.