In 1861 the Llynvi Valley Railway was opened in Glamorganshire, Wales, to convey mineral products to the Bristol Channel at Porthcawl. It adopted an earlier tramroad, the Duffryn Llynvi and Porthcawl Railway. The Llynvi and Ogmore Railway (L&OR) was opened in 1865, and the two companies amalgamated to form the Llynvi and Ogmore Railway in 1866. At first Porthcawl harbour was an important destination for onward transport, but this soon declined.

The area covered by the two lines combined developed considerably serving collieries and the iron and zinc smelting industries, and the system was extremely busy in conveying minerals up until 1914. A number of extensions to the system were made, even after takeover by the Great Western Railway in 1873 for management purposes and in 1883 as full amalgamation.

Passengers were carried on parts of the network, but were never dominant except at Porthcawl, which declined as a harbour and arose as a holiday and residential location. As the mineral industries declined after 1945 the railway network followed, but in 1992 the line from Bridgend to Maesteg was reopened to passenger trains, and that is the principal remaining railway activity on the old network.

Industry before the railway

The Llynfi Valley runs north to south, from the high mountains north of Maesteg down to Tondu where it joins the River Ogmore, which itself continues through Bridgend to the Bristol Channel at Ogmore-by-Sea.

In the first half of the eighteenth century the area was entirely rural, but coal outcropped in the ground and was used by farmers, and some was taken away for sale by pack animal. Charcoal had been used for smelting iron but in the second half of the 18th century, coke began to be used instead; limestone was available locally and was used in the process.

Cefn Cribwr had been the site of a blast furnace established by John Bedford in 1780, though that declined after Bedford's death in 1791. William Bryant took over the works in about 1825. Elsewhere though, the industry had been on a small scale. It was in 1826 that the Maesteg Iron Company was founded: the first furnace was blown in 1828 and by 1831 the population of the local hamlet had tripled (Cwmdu, from 968 to 2,880). The Maesteg Iron Company later became known as the Old Works and its foundation started the large scale industrialisation of the process locally.

This was followed in 1831 by the establishment by James Allen of the Spelter Works near what is now Caerau. Spelter is an ore of zinc; it was mined in Cornwall and brought to the area for smelting. The locality of the works became known as Spelter, and the name appears on present-day maps. In 1839 Allen and his partners established another iron company, the Cambrian Iron Works (later known as the Llynvi Iron Works), in Maesteg.Paul Reynolds, The Ironmasters' Bags: The Postal Service in the South Wales Valleys, c. 1760 to c. 1860, Lulu.com, 2010, Philip Riden, John Bedford and the Ironworks at Cefn Cribwr, self published by Philip Riden, 1992,

These industries needed transport away to market, and this was chiefly by sea from wharves on the Bristol Channel. Transport from the works and the collieries to the coast was expensive and slow, generally taking place on the backs of pack animals. The ordinary road network was quite inadequate for industrial development.Clive Smith, Railways of the Llynfi Valley, Alun Books, Port Talbot, 1985,

Duffryn Llynvi and Porthcawl Railway

Even the earlier, small-scale iron and coal industries around Maesteg, and further south along the Cefn Cribwr ridge, created a demand for ship-borne transport to market. The Duffryn Llynvi and Porth Cawl Railway (DL&PR) was promoted by local people, including the Earl of Dunraven, Sir John Nicholl and Sir Digby Mackworth. They obtained an act of Parliament, the (6 Geo. 4. c. civ), on 10 June 1825 to make a horse-drawn toll railway from Duffryn Llynvi to Pwll Cawl (or Porthcawl, or Pwll-y-Cawl), and to improve the harbour there by the erection of a jetty, and charge harbour dues and wharfage. The engineer was John Hodgkinson.Alun Morgan, Porthcawl, Newton and Nottage: A Concise Illustrated History, D Brown and Sons Limited, Cowbridge, 1987, , pages 40 to 47D S M Barrie, revised Peter Baughan, A Regional History of the Railways of Great Britain: volume 12: South Wales, David St John Thomas, Nairn, 1994, , pages 178 to 184D S Barrie, The Porthcawl Branch in The Railway Magazine, March 1954Clive Smith, Bygone Railways of the Afan, Alun Books, Port Talbot, 1982,

As well as conveying mineral products down to Porthcawl for shipping transport away, it was to bring limestone (used for fluxing in iron making) up from Cornelly, and also to a certain extent timber for mine use. The line was to use stone-block sleepers and cast iron fish-bellied edge rails,Bertram Baxter, Stone Blocks and Iron Rails (Tramroads), David & Charles, Newton Abbot, 1966, pages 220 and 221 and the track gauge was to be and its length would be .Dendy Marshall says on page 93 that this and the Bridgend Railway were plate railways, opened in 1834, "rather a late date for a plate-railway". Smith says the gauge was , as do Barrie and Baughan. Chapman, in Ely Valley says the gauge was . Barrie in The Porthcawl Branch says the line was "reputedly constructed to the unusual gauge of 4 ft 7 in, although that may have been a discrepancy in point of measurement."C F Dendy Marshall, A History of British Railways Down to the Year 1830, Oxford University Press, 1938 reprinted 1971, Colin Chapman, The Ely Valley Railway: Llantrisant – Penygraig, Oakwood Press, Usk, 2000, , page 26 and 27

Capital was £40,000 and this was all subscribed before the act was passed, but obtaining a mortgage loan proved much more difficult, and a further act of 14 May 1829, the (10 Geo. 4. c. xxxviii), was required to elevate the priority of the mortgage payments in order to secure the loans.

Construction of the line only began in 1826, and the line from the Maesteg ironworks at Duffryn Llynvi to Porthcawl was opened on 22 June 1828.

Duffryn Llynvi was the name of the ironworks in Maesteg—the district was also known as Garnlwyd. Many other works and collieries were served intermediately by the new line. Duffryn Llynvi was reached in 1828 when the line opened; the line was extended to Allen's spelter works in 1831. The line was soon extended further to the Blaenllynfi Colliery, in present-day Caerau; the colliery was alongside what is now Caerau Road (and Railway Terrace).

There were already a number of tramroad connections to works in the Tondu and Maesteg area, and the opening of the line, giving easy access to the dock at Porthcawl, encouraged the establishment of further metal foundries and collieries, in many cases served by private tramroads in connection with the and in other cases purely internal and private. In 1839 a new ironworks, known as the Cambrian Ironworks, was established by Allen and his partners established another iron company, the Cambrian Iron Works (later named the Llynvi Iron Works), and in 1846 the Forge was added to these works.

The journey time from Duffryn Llynvi to Porthcawl was just over six hours; the return journey, uphill, took eight hours. A regular time table was operated on the line, and the passing places were designated. Each train was pulled by a team of three horses. As a toll railway the line was open to private carriers who paid tolls for the use of the line; the company did not operate trains nor own wagons of their own.

However it was becoming apparent that the harbour improvements at Porthcawl were inadequate, not doing enough to shelter vessels there from the prevailing winds, and it tended to be used in summer only.

In 1840 a further act, the (3 & 4 Vict. c. lxx), was obtained, enabling money to be raised for the provision of coal chutes, and the construction of a new wet dock. This considerably improved business, and the was able to pay dividends of 8% later.

Route of the Duffryn Llynvi and Porthcawl Railway

Running south from Blaenllynfi Colliery the line proceeded along the east bank of the River Llynfi to Tywith (or Ty-chwyth) and through Nantyffyllon by Heol Tywith. From there it crossed the river and followed along Bangor Terrace, behind High Street, crossing the road near the Traveller's Rest Hotel, through the Llynvi Iron Works to Llynfi Road. It then continued through Commercial Street to Bethania Street and along Llwydarth Road to the Cerdin (Cross Inn); thence to the Llwyndurys weighing house at Pontrhydycyff (Llangynwyd), after which it ran across the main road, and continued behind the modern Maesteg Comprehensive School to the old Gadlys Woollen Mill, where its embankment can be traced across Nant-y-Gadlys. The tramway then continued to Cefn Ydfa and to Tondu, where it turned west to Cefn Cwsc, Kenfig Hill, Pyle, Cornelly and finally to the harbour at Porthcawl.

The route of the tramway from Commercial Street to the Cross Inn later became the main road from the Maesteg town centre. Its unusual width is explained by the development of the railways and a road alongside it before the housing was built up.

The line was in length and there was a fall of , making an average gradient of down to Porthcawl.D S Barrie, Railways of the Bridgend District, in The Railway Magazine, July 1955

Bridgend Railway

The Bridgend Railway CompanyBaxter refers to this as the Bridgend Railroad Company; however section 1 of the Bridgend Railway Act 1828 created the company of proprietors under the name 'Bridgend Railway Company'. was authorised by the on 19 June 1828 to build a line from Bridgend to join the at Park Slip, a little west of Tondu, to Bridgend. The capital was £6,000.

The distance was ; it was sponsored by the same promoters as the , and like the it was a gauge edge railway, using cast iron fish-bellied rails on stone block sleepers.Robin G Simmonds, Port Talbot Railway & Docks Company and the South Wales Mineral Railway Company: Volume 1: 1853-1907, Lightmoor Press, Lydney, 2012, , page 27

The line entered Bridgend along Quarella Road and terminated at The Green; very little of this line was used for the later Tondu branch line railway. The line opened on 22 October 1830.The Hereford Journal edition of 3 December 1830 refers to the line opening on the "22d inst." At that time newspapers often syndicated minor news items from other periodicals without troubling to edit or update them. The same report with similar wording but starting "On Friday, October 22, the Bridgend Railway was opened to the public..." is quoted from The Cambrian newspaper by Smith in Railways of the Llynfi Valley, page 11. Dendy Marshall muddies the water considerably by reporting the line as a plateway opening in 1834, "rather a late date for a new plateway". Awdry agrees 1830 (page 17) but Barrie and Baughan say 1834 (page 179).

Llynvi Valley Railway

The Duffryn Llynvi and Porthcawl Railway and the Bridgend Railway were simply horse-operated tramroads using primitive stone-block sleepers and cast iron rails, and as the volume of mineral activity increased, they were overwhelmed by the business offered. By the mid 1840s railway technology had advanced considerably; the South Wales Railway had been projected for some years and obtained its authorising act of Parliament, the South Wales Railway Act 1845 (8 & 9 Vict. c. cxc) in 1845, so that soon the area would be connected by a trunk railway to the British network. Local businesspeople decided to promote a new railway to modernise the and Bridgend Railway networks.