By the 1830s the Dowlais Ironworks in Merthyr Tydfil was the largest in the world. Josiah Guest, who owned the ironworks, realised that it would be an advantage to link his ironworks with Cardiff docks. Guest joined forces with Anthony Hill, owner of another ironworks near Merthyr Tydfil, to form the Taff Vale Railway Company. Isambard Brunel, a talented engineer from Bristol, was recruited to build the railway.
The Taff Vale Railway was completed in 1841. It was now possible to transport goods from Merthyr Tydfil to Cardiff in less than an hour. Later, branches were built to link the mining valleys with Welsh ports and England's fast growing industrial towns and cities. The railway network reduced transport costs so much that it was now profitable to export Welsh coal to countries as far away as Argentina and India.