From 1839 the trustees of the Marquis of Bute, operated a large dock operation in Cardiff, the "Bute Docks". This was very successful, but was overwhelmed by the huge volume of coal exported through Cardiff. At the same time it was seen that railway companies, especially the Taff Vale Railway (TVR), were making money conveying the coal to the docks.
The Bute Docks company decided to build a railway from Pontypridd to their dock; they obtained an act of Parliament, the Cardiff Railway Act 1898 (61 & 62 Vict. c. cclxii), giving authority for part of the route in 1898, and changed the company name to the Cardiff Railway. To be successful, they needed to make a junction with their main rival, the TVR, at Treforest. A single mineral train traversed the junction in 1909 but legal challenges prevented any further use. The Cardiff Railway had built an expensive railway line that failed to connect with the collieries beyond Pontypridd. The company became part of the Great Western Railway (as did the TVR) in 1923.
A low-key passenger service was operated, and a colliery at Nantgarw was served until 1952. The passenger service was cut back to Coryton in 1931 and continues to operate today.