The Llanidloes and Newtown Railway was an early Welsh railway, and the first to be built by David Davies, Llandinam. This line was unusual in that at neither terminus did it connect with any other railway, and the engines and carriages had to be carried on specially constructed wagons from Oswestry, 36 miles away.
The Welsh railway network was built by a series of small railway companies, which by the time of grouping in 1923 had all become part of the Great Western Railway. In 1845, a broad gauge scheme had been proposed to connect industrialised Northwest England and Manchester to the deep water port of Milford Haven, giving an alternative to access North America than the dominant Port of Liverpool. However, the Manchester and Milford Railway did not gain approval until 1859, when the London and North Western Railway backed a standard gauge proposal. However, by that time Parliament had authorised a second railway between Llanidloes and Aberystwyth, authorising the Mid-Wales Railway in 1860.
By 1861 both railways were fast approaching Llanidloes, the M&MR from Llangurig in the west, the MWR from Builth Wells in the south. After fierce clashes between engineers and navies building the two schemes, in 1864 Parliament approved the construction of a joint line, the Llanidloes and Newtown Railway. This would extend southwards of Llanidloes with 1.5 miles (2.4 km) of double track to Penpontbren Junction, where the M&MR's Llangurig branch for Strata Florida, and MWR mainline for Builth Wells would diverge.
The M&MR and MWR were to pay 5% per annum on construction costs and maintenance. Also the three companies were to pay equal shares of interest and running costs for the new Llanidloes railway station. These charges were eventually to prove crippling for the M&MR.
Completed in 1859, the railway ran from Penpontbren Junction in the south, via the company headquarters at Llanidloes. There were then two intermediate stations before Moat Lane Junction, where the Newtown and Machynlleth Railway extension of the Aberystwyth and Welsh Coast Railway joined the line. Passing two further halts, the line entered Newtown, the joint station with the Oswestry and Newtown Railway which took the line northwards to towards Shrewsbury, Crewe and Manchester. The railway had no rolling stock of its own, simply allowing its partners to access it rails.
In 1860 the L&NR was absorbed as part of the Cambrian Railways, along with all of its connecting railways. It then became part of the GWR on grouping in 1923.
After the Llangurig branch spur was fully built, a single MWR goods train hired for the day by the L&NR ran along its length, at which point the L&NR invoiced the M&MR for the cost of the joint station at Llanidloes. The branch service was immediately terminated, being wholly unprofitable without through traffic. The M&MR continued to pay for the cost of the joint station they could not reach, later abandoned once the original branchline from Strata Florida to a junction with the Aberystwyth and Welsh Coast Railway at Aberystwyth was completed in 1865.
The southern section from Moat Lane Junction to Llanidloes (which linked with the Mid-Wales Railway route to Builth) closed on 31 December 1962.
A section of the line - from Newtown to where the later Cambrian Line diverges to Machynlleth, at the former Moat Lane Junction, remains in use.