5917 was built in 1952 by American company Baldwin Locomotive Works. 5917 was part of the D59 class with a wheel configuration of 2-8-2, and like the rest of its class was originally built as an oil burning locomotive. This was due to the coal shortages impacting New South Wales at the time of the order.
The D59 class was designed to have a short tender so it could turn on standard 60ft turntables. However upon delivery it was found that most 60ft turntables could not turn the locomotives due to their heavy weight.
Although the D59 class was capable of running throughout the state, the class was limited to the lines with oil servicing facilities. This included the Main North, North Coast and Sydney metropolitan lines.
Starting in 1961 all but three of the D59 class locomotives including 5917 were converted to coal burning engines.
5917 was used for hauling freight and the occasional local passenger service. While in Bathurst, it was equipped with larger buffers for banking trains and still carries this modification today.
On 16 August 1972, 5917 was withdrawn from service and placed in storage at Enfield.
In 1973 care for the locomotive passed to the Lachlan Valley Railway Society. It operated for the Lachlan Valley Railway from the mid 1970s and in 1986 the engine took part in the first Hunter Valley Steamfest.
More recently, 5917 was taken out of service in 2009 for major boiler works and repairs, returning to service in 2014.
Of the 20 D59 class locomotives built 15 have been scrapped with only five preserved. 5917 is the only locomotive from this class still operational.