(photo circa 1900) , the former limit of electrification has been reduced to single track The
Sydney Railway Company, a private company established to serve the interests of the port of Sydney, announced proposals to build a railway line to
Bathurst in 1848. The company was taken over by the New South Wales Government in 1854, and in 1855 the first railway in the state was opened between
Sydney and the present-day
Granville (see
Rail transport in New South Wales). This railway was extended from Granville to the current
Parramatta station and
Blacktown in 1860 and
Penrith in 1863. The railway then crossed the
Blue Mountains between 1867 and 1869. The Blue Mountains were a significant geographical barrier to the development of western New South Wales, and the crossing required significant feats of engineering for the railways, including two 'Zig Zags': one for the ascent at Lapstone, and another for the western descent. The first
"little" zigzag line opened near
Glenbrook in 1867 as part of the ascent of
Lapstone Hill on a gradient of 1 in 30–33. It was built with comparatively light earthwork, although it included a substantial seven-span sandstone viaduct (the Knapsack Viaduct) built by engineer,
John Whitton. By 1910, the line was replaced with a gentler alignment with 1 in 60 (1.67%) grades. The line reached
Wentworth Falls in 1867 and
Mount Victoria in 1868. On the western descent from the Blue Mountains, the
Lithgow Zig Zag was constructed between 1866 and 1869. It was laid out in the shape of a 'Z' including reversing
points. It involved extremely heavy rock cuttings, three fine stone viaducts with semi-circular arches and a short tunnel. The Lithgow Zig Zag was replaced in 1910 by a deviation, which included ten tunnels. From the western foot of the Blue Mountains, the line was promptly extended to
Wallerawang by 1870,
Tarana in 1872,
Bathurst,
Blayney in 1876 and
Orange in 1877. By 1877, there was significant political pressure to minimise the diversion of trade from western New South Wales to Victoria and South Australia via river trade along the
Darling and
Murray Rivers. The town of
Bourke had become the key centre for pastoralists in western New South Wales since its formation in 1861. Provision was thus made to extend the line to Dubbo, reaching
Wellington in 1880 and
Dubbo in 1881. At the time, Dubbo had grown into a town of strategic importance on the stock routes between northern New South Wales and the Victorian goldfields. Beyond Dubbo, the railway opened up new land to European settlement, and was directly responsible for the development of townships. The line reached the future site of
Narromine in 1883, and the railway station was the first building in the future settlement. The line reached the site of
Nevertire in 1882, serving the nearby established village of
Warren (a branch opened to Warren in 1898). Construction reached the site of
Nyngan in 1883, with the nearby coach-stop village of
Canonbar moving in its entirety to establish the town of Nyngan. Beyond Nyngan, the line swept across the plains in a straight line for , then the longest stretch of straight railway line in the world. It reached the temporary terminus of
Byrock in 1884 before reaching its final destination of
Bourke in 1885. Wool and livestock was the main source of goods traffic on the line throughout its life. In the 1890s a severe drought caused a significant downturn in traffic. In the following decade a branch to Brewarrina (in 1901) increased its catchment while that to Walgett (in 1908) from another artery, reduced its catchment area. The line beyond Dubbo became loss-making in 1901, and continued that way throughout its existence. Tonnages increased following World War 2, but declined from the 1970s. Passenger services beyond Dubbo ended in 1974.
Electrification reached Parramatta in 1928 and Penrith in 1955. In the 1950s, the section of the line over the Blue Mountains was electrified primarily as a means of easing the haulage of coal freight from the western coalfields to the coastal ports, but a by-product of this programme was the introduction of electric interurban passenger services as far west as Bowenfels, later cut back to the current terminus of Lithgow. Since the late 1990s goods trains are now exclusively diesel hauled, with the only electric trains being passenger services using double deck interurban cars. By 1980, quadruplication of the track between
Blacktown and
St Marys was completed. With the introduction of the
XPT, the tracks between Blacktown & St Marys were authorised for 160 km/h XPT track speeds by the
State Rail Authority in 1982. These speeds were subsequently reduced to 115 km/h (equal to the prior non-XPT speeds) due to signalling deficiencies (related to emergency trip-braking at high speeds) being discovered in 2006 by
CityRail engineers. The deficiencies were not addressed with the introduction of
ATP in 2021 and the lowered-speeds were permanently programmed into the new system. In June 1989, during the Queen's Birthday weekend,
Flying Scotsman and C38 class locomotive
3801 used the railway line for its reenactment of the Night Mail, a recreation of the historic "Through West Mail." In the 1990s the operator of interstate freight, the
National Rail Corporation, made the decision to divert Sydney- Perth traffic from the Blue Mountains section, to travel via the
Main South line to
Cootamundra, and then via the
cross country line to
Parkes. This resulted in reduced goods traffic and subsequent reduction of the line between Wallerawang and Tarana from double to single track. Significant flooding saw the line cut between Nyngan and Bourke in April 1989, and the army destroyed a section of track north of Nyngan to relieve flood waters surrounding the town. It was not financially viable to repair and maintain the line, and the line was thus abandoned between Nyngan and Bourke. ==Branch lines==