The line was built by George Hudson's York and North Midland Railway and opened on 7 July 1845. The line was constructed remarkably quickly by the standards of the time, taking just one year and three days to complete the 42-mile route. This feat was possible because the Y&NMR decided against the more costly and time-consuming option of building a tunnel through the Howardian Hills south of Malton. Instead the chosen route meanders with the River Derwent for around four miles, creating a slower but more scenically pleasant experience for passengers The railway line was opened with a ceremony for invited guests who were taken by George Hudson on a train of two engines and 40 first class coaches, which left York at 11.00 am. The line was initially single track and the journey to Scarborough took three and a half hours. In Scarborough the guests were treated to a lunch. After a return journey to York, the guests were treated to dinner in the Guildhall, hosted by the Lord Mayor of York. The new railway included a 6-mile branch from Rillington to Pickering that connected with the horse-worked Whitby and Pickering Railway which the Y&NMR immediately proceeded to take over and upgrade for steam traction. Most of the intermediate stations on the line were closed to passengers in September 1930 as the number of excursion and holiday trains going straight through to Scarborough during that period meant that the line was too busy to accommodate local services. The closed stations retained their goods facilities and were maintained for occasional passenger use by excursion trains until the 1960s.
Modern
There are currently plans to re-open the stations at Haxby and Strensall due to the growth of population in those areas. There have been suggestions to re-open these stations since 1990 when it was pointed out that if they were inside a metropolitan county, then they would be re-opened very quickly. In January 2009 funding to re-open Haxby station was confirmed but the Strensall plan has yet to come to fruition. In 2014, work started on replacing the 1840s built bridge that carries the railway over the River Ouse. Network Rail spent £6 million on the entire project and used boats and pontoons floated on the River Ouse to reach the bridge. The new bridge opened to traffic on 23 February 2015. The route has 89 level crossings between York and Scarborough; 12 are supervised, 10 automatic and 67 are user worked crossings. All supervised and automatic crossings and the residual seven signal boxes en route will be closed and control handed over to the York Rail Operating Centre by 2025.
Services
Services operated along this line are run by TransPennine Express. Services are roughly hourly and operate to and from either York, Manchester or Liverpool with a reduced service on Sundays. This is part of the North TransPennine route. Rolling stock on this line has consisted almost entirely of Class 185 DMUs since early 2007. East Midlands Railway also run occasional summer services. The new Northern franchise run by Arriva Rail North had intended to start running services over the line in December 2019, with an additional 14 trains per day from Monday to Saturday in addition to the current TransPennine Express service. The service has been delayed into 2020, with no definitive start date. In February 2020, driver training started on the line using PacerClass 142 trains, with a view to the service starting in May 2020. Scarborough also sees steam-hauled summer specials from York, hauled by various preserved steam locomotives. There is also talk of reinstating the pre-1965 link to Pickering to connect the North Yorkshire Moors Railway to the national network from its southern end, allowing trains from Malton and beyond to reach Whitby. Such a move has been considered but does not seem likely for the foreseeable future.
Incidents
On 25 August 1845 the 12.15 train from York came off the rails a quarter of a mile south of Kirkham Abbey, in the vicinity of Crambe, due to subsidence of an embankment beside the River Derwent. Thomas Cabry was on the engine and hurt his foot in the process.. On 3 February 2009, a car hit the back of a train passing over Knapton level crossing. The driver was taken to hospital, but he was not kept in. There were no casualties on the train. The level crossing is an AHBC – automatic half barrier crossing.