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 as of 2020, only a short stub to a quarry at Machen remains rail connected.