The Hejaz railway (also spelled Hedjaz or Hijaz; حجاز تيمور يولى, Hicaz Demiryolu) was a narrow-gauge railway ( track gauge) that ran from Damascus to Medina, through the Hejaz region of modern day Saudi Arabia, with a branch line to Haifa on the Mediterranean Sea. It was a part of the Ottoman railway network and the original goal was to extend the line from the Haydarpaşa Terminal in Kadıköy, Istanbul beyond Damascus to the Islamic holy city of Mecca. However, construction was interrupted due to the outbreak of World War I, and it reached only to Medina, short of Mecca. The completed Damascus to Medina section was .
The main purpose of the railway was to establish a connection between Istanbul, the capital of the Ottoman Empire and the seat of the Islamic Caliphate, and Hejaz in Arabia, the site of the holiest shrines of Islam and Mecca, the destination of the Hajj annual pilgrimage. Other objectives were to improve the economic and political integration of the distant Arabian provinces into the Ottoman state, and to facilitate the transportation of military forces.
Railways were experiencing a building boom in the late 1860s, and the Hejaz region was one of the many areas up for speculation. The first such proposal involved a railway stretching from Damascus to the Red Sea. This plan was soon dashed however, as the Amir of Mecca raised objections regarding the sustainability of his own camel transportation project should the line be constructed. Ottoman involvement in the creation of a railway began with Colonel Ahmed Reshid Pasha, who, after surveying the region on an expedition to Yemen in 1871–1873, concluded that the only feasible means of transport for Ottoman soldiers traveling there was by rail. Other Ottoman officers, such as Osman Nuri Pasha, also offered up proposals for a railway in the Hejaz, arguing its necessity if security in the Arabian region were to be maintained.
Many around the world did not believe that the Ottoman Empire would be able to fund such a project: it was estimated the railway would cost around 4 million Turkish lira, a sizeable portion of the budget.