Siliguri, located at the base of the Himalayas, was connected with Calcutta (now Kolkata) by standard gauge railway in 1878. Between Siliguri and Darjeeling tonga services ran on a cart road (the present day Hill Cart Road). Franklin Prestage, an agent of Eastern Bengal Railway Company approached the government with a proposal of laying a steam tramway from Siliguri to Darjeeling. Sir Ashley Eden, the Lieutenant Governor of Bengal, formed a committee to assess the feasibility of the project. The proposal was accepted in 1879 following the positive report of the committee. Construction started the same year.
Gillanders Arbuthnot & Company was given the responsibility of construction. By March 1880, the line was extended up to Tindharia. Lord Lytton, the first Viceroy to visit Darjeeling was conveyed in the train up to Tindharia. The stretch from Siliguri to Kurseong was opened on 23 August 1880. The Siliguri to Darjeeling track was inaugurated on 4 July 1881. The name of the rail company was promptly changed to Darjeeling Himalayan Railway Company. Initially the alignment of the railroad followed Hill Cart Road. However, it became apparent that in some areas the steepness of the road was more than the locomotives could easily maneuver. In 1882 four loops and four reverses (zig-zags) were constructed between Sukna and Gayabari to ease the gradient. The line was extended by a quarter of mile to Darjeeling Bazar in 1886. The Darjeeling station was renovated in 1891 while Kurseong got a new station building and storage shed in 1896. Darjeeling Himalayan Railway (DHR) suffered from an earthquake in 1897 and a major cyclone in 1899. By 1909–1910, DHR was carrying 174,000 passengers and 47,000 tons of goods annually. The first bogie carriages entered service, replacing very basic 4 wheel carriages. DHR extension lines were constructed up to Kishanganj in 1914, and Gielkhola in 1915. At Tindharia the railway works were relocated from behind the loco shed to a new and extensive site.
The Batasia Loop was constructed in 1919, eliminating problems by creating easier gradients on the ascent from Darjeeling. However, DHR started to face competition from bus services that started operating in the Hill Cart Road, and took less time than the railway to reach Darjeeling. In 1934, a major earthquake in Bihar shook all of Northeast India. Many buildings in Darjeeling were heavily damaged and the railway was also badly affected, although it soon recovered and played a vital role in transporting repair materials. During World War 2, DHR played a vital role transporting military personnel and supplies to the numerous camps around Ghum and Darjeeling.
After the Independence of India, DHR was purchased by the Indian Government and was absorbed into the Indian Government Railways organisation. DHR came under the management of the Assam Railways organisation. In 1952, Assam Railway, including DHR, became part of the North Eastern Railway Zone and later in 1958, a part of the Northeast Frontier Railway Zone of Indian Railway. In 1962, the line was realigned at Siliguri and extended by nearly 4 miles (6 km) to New Jalpaiguri (NJP) to meet the new broad gauge line there. It opened for freight that year and for passengers in 1964. The loco shed and carriage depot at Siliguri Junction were relocated to NJP.
DHR remained closed for 18 months during the hostile period of Gorkhaland Movement in 1988–1989. DHR was declared a World Heritage Site by UNESCO in 1999, becoming only the second railway in the world to have this honour bestowed upon it, the first one being Semmering Railway of Austria in 1998.
The Darjeeling Himalayan Railway has long been viewed with affection and enthusiasm by travellers to the region, and the Earl of Ronaldshay gave the following description of a journey in the early 1920s:
"Siliguri is palpably a place of meeting.[.....] The discovery that here the metre gauge system ends and the two foot gauge of the Darjeeling-Himalayan railway begins, confirms what all these things hint at.[....]One steps into a railway carriage which might easily be mistaken for a toy, and the whimsical idea seizes hold of one that one has accidentally stumbled into Lilliput. With a noisy fuss out of all proportion to its size the engine gives a jerk - and starts.[....] No special mechanical device such as a rack is employed - unless, indeed, one can so describe the squat and stolid hill-man who sits perched over the forward buffers of the engine and scatters sand on the rails when the wheels of the engine lose their grip of the metals and race, with the noise of a giant spring running down when the control has been removed. Sometimes we cross our own track after completing the circuit of a cone, at others we zigzag backwards and forwards; but always we climb at a steady gradient - so steady that if one embarks in a trolley at Ghum, the highest point on the line, the initial push supplies all the energy necessary to carry one to the bottom."