The Brecon and Merthyr Tydfil Junction Railway (B&MR) was a railway company in Wales. It was originally intended to link the towns in its name. Finding its access to Merthyr difficult at first, it acquired the Rumney Railway, an old plateway, and this gave it access to Newport docks. This changed its emphasis from rural line to mineral artery.
It opened at the Brecon end to a point near Dowlais in 1863, and in 1865 it opened a disconnected section from Rhymney to Newport. In due course the company connected the two sections and reached Dowlais and Merthyr, but had to concede sharing a route with the powerful London and North Western Railway.
The B&MR was always short of money, and was notable for its prodigious gradients, but it survived until the grouping of 1923, when it became part of the Great Western Railway. Its network declined steeply after 1945, and passenger operation ceased in 1962. Goods and mineral operation also lost its market, and at present (2017) only a short stub to a quarry at Machen remains rail connected.
Brecon was an important regional centre in mediaeval times, due to its location at the confluence of the River Honddu and the River Usk. Its relatively remote location meant that transport was always an important consideration.
The difficult terrain southwards would require crossing the ridge of the Brecon Beacons into the high ground at the head of the South Wales Valleys, and the first turnpike connected eastward to Abergavenny and south-westward to Swansea.
The Brecknock and Abergavenny Canal, later part of the Monmouthshire and Brecon Canal, was opened to Brecon in 1800 continuing the alignment to the east.
In 1816 the Hay Railway was opened; this was a horse-drawn plateway 24 miles long, connecting Brecon to Hay, and later Eardisley.