In 1900 the Ottoman Sultan Abd Al Hamid ordered the construction of a railway from Damascus via Al-Ula to Al-Madina, through the Hijaz region of Arabia, to carry Muslim pilgrims to the Holy Cities (its true purpose was probably to strengthen the Ottoman grip in the region and promote trade between Damascus and Madinah).
Hijaz Railway was built by approximately 5,000 Turkish soldiers, and a German engineer, Meissner Pasha. It was opened throughout in September 1908. The well preserved Railway workshop, stations, engine and rolling stock can still be seen in Madain Salih which was an important depot of Hijaz Railway
The stations, engine shed, lines and installations are in a fine state of preservation at Al Hijr (Mada'in Salih) railway station. The station is comprised of 16 buildings and a water reservoir. The buildings included rest houses for passengers, staff housing, a fortress, and storerooms for luggage, a shed for repairing locomotives, a workshop for fixing engines and lavatories.
During the Arab Revolt of 1916-18, the hijaz railway inevitably became a target of anti-Turkish forces. It was extensively damaged, and the section in Saudi Arabia was finally abandoned in about 1924.
Courtesy: www.splendidarabia.com