Aberdeen Gas Works was extended and reconstructed in the 1880s. For the delivery of coal from the harbour, as part of the improvements a railway connection was provided. This consisted of a single track railway along Church Street and Miller Street (a distance of about 250m), connecting the Gas Works with Waterloo Quay.
To work the line, the Corporation of Aberdeen Gas Department ordered a new steam locomotive. This was built by Black Hawthorn of Gateshead, and was delivered new to Aberdeen in October 1887. Named 'City of Aberdeen', it was fitted with motion skirts to conceal the working parts for safety when working the street tramway. Later as coal traffic increased it shared duties with four other steam locomotives (three of which are now also preserved), and continued in use until the late 1950s.
Remarkably, 'City of Aberdeen' was put back into working order by 1967, but in 1971 the Gas Works rail connection was closed when the manufacture of gas from coal ceased. 'City of Aberdeen' remained at the works until demolition in 1975, and was donated by Scottish Gas.