The Mid-Wales Railway (MWR) was an early railway company operating in Mid-Wales. It was a constituent part of the Cambrian Railways.
The company was formed in 1859 and parliamentary approval was received on 1 August for the northern section of the line from Llanidloes, Montgomeryshire to Llandovery, Carmarthenshire. Approval for the southern section from Newbridge-on-Wye to Three Cocks Junction in northern Brecknockshire was received on 3 July 1860.
The first sod was ceremonially cut on 2 September 1859, but further work on the 46.7 mile line was delayed until 1862. A formal opening ceremony was held on 23 August 1864, and the line to Three Cocks Junction was opened goods traffic on 1 September.
Parliament had authorised both the MWR and the Manchester and Milford Railway to connect Llanidloes to Aberystwyth, and so the M&MR had prioritised construction in the Llanidloes area. Eventually an agreement was reached to form the joint Llanidloes and Newtown Railway, which extended 1.5 miles (2.4 km) south to Pentpontbren Junction, where the MWR and M&MR's short-lived Llangurig branch diverged. The L&NR opened its line in 1859, enabling through working to and from the MWR line.
The MWR worked the line of the Hereford, Hay and Brecon Railway from 1 October 1868 until that company was taken over by the Midland Railway on 1 October 1869. The line from Builth Road to Llandovery was not built, but a connection to the Central Wales Extension Railway was completed on 1 November 1866, enabling goods trains to run to and through that station.
At Brecon, following the initial opening of three separate stations, a joint station was created at Free Street.
At Llanidloes railway station, the grand junction building that was created in anticipation of M&MR traffic which never materialised, since the Mid Wales Railway never completed their section of the Llangurig - Strata Florida - Aberystwyth line.