The line of the preserved Nene Valley Railway was once part of the first railway to reach Peterborough being the eastern portion of the Northampton and Peterborough Railway (N&PR) which opened to the public on 2nd June 1845. It was not an independent railway but a branch of the London & Birmingham Railway (L&BR) which left its main line at Blisworth and ran via Northampton, Thrapston, Oundle and Wansford to Peterborough. Most of its route was an easy one following the valley of the River Nene and consequently it became known as the Nene Valley line.
The London & North Western Railway (L&NWR), of which the L&BR had become part in 1846, eventually found that its indirect Nene Valley route from Peterborough to Birmingham and the Midlands, which required a reversal at Blisworth, to be both longer and slower than those of its competitors. Thus in November 1879 a connecting line was opened from Yarwell Junction (beyond Wansford Tunnel, west of Wansford Station) to Seaton so providing access to Rugby. The resulting Peterborough to Rugby line then developed as a secondary main line linking Yarmouth and Peterborough to the Midlands, Birmingham and North Wales.
Although the Great Northern Railway (GNR) made a connection from Stamford to the Nene Valley line at Wansford in 1867 by the Wansford Branch of the Stamford & Essendine Railway, this did not prove profitable and closed in 1929. Its embankment can be seen running northwards east of Wansford River bridge. A more important connection for the GNR was the Fletton Loop, opened in 1883, which allowed its trains to run to Leicester for many years. This left the GNR main line at Fletton Junction and connected with the Nene Valley line at Longville Junction just to the east of the present Orton Mere Station. This loop is still in position and provides the Nene Valley Railway with a connection to the Railtrack network.
The L&NWR became part of the London, Midland & Scottish Railway in 1923 which itself became part of British Railways in 1948. Although there was a decline in traffic in the 1930s the Nene Valley line was extremely busy during the years of World War 2. It was the movement of traffic to the roads in the 1950s and '60s that resulted, initially, in the closure of certain stations on the line with through passenger services on the Northampton line ceasing in 1964 and freight in the following year. In 1966 through rail services ceased on the Rugby line. Some local goods and special services continued until 1972 in which year the Nene Valley line was closed completely.
In April 1973 the Peterborough Railway Society, forerunner of the Nene Valley Railway and which was using the sidings of the British Sugar Corporation (BSC) in Peterborough, received permission from BR to use Wansford signal box as its new base. Rolling stock started to arrive at Wansford in September and in November a tenancy agreement gave the Society use of part of the Wansford site. The Peterborough Development Corporation (PDC) purchased the line between Longville Junction and Yarwell Junction in March 1974 and leased it to the Society. Stock gradually moved from the BSC to Wansford with Wansford Steam Centre opening at Easter 1974 and a shuttle service was operated between Wansford and Yarwell in 1975.
Between 1974 and 1977 the line from Wansford to Longville Junction was gradually upgraded to passenger standards. Following an inspection by the Railway Inspectorate a Light Railway Order was granted and the line between Wansford and Orton Mere officially opened in June 1977. The railway's aim had always been to have closer access to the centre of Peterborough and planning permission was received by the end of 1983. With the track having been already lifted by BR, track laying commenced in September 1984 and following the usual inspection the first train to Peterborough Nene Valley Station ran on 24th May 1986. At the end of June the extension from Longville Junction to Peterborough was officially opened by HRH Prince Edward. The freehold of the line, formerly owned by the PDC, was transferred to the railway in 1998.