In the 19th century, there were accounts that the extant wells and oasis agriculture of al-Hijr were being periodically used by settlers from the nearby village of Tayma. This continued until the 20th century, when the Hejaz Railway that passed through the site was constructed (1901–08) on the orders of Ottoman sultan Abdul Hamid II to link Damascus and Jerusalem in the north-west with Medina and Mecca, hence facilitating the pilgrimage journey to the latter and to politically and economically consolidate the Ottoman administration of the centers of Islamic faith. A station was built north of al-Hijr for the maintenance of locomotives, and offices and dormitories for railroad staff. The railway provided greater accessibility to the site. However, this was destroyed in a local revolt during World War I. Despite this, several archaeological investigations continued to be conducted in the site beginning in the World War I period to the establishment of the Kingdom of Saudi Arabia in the 1930s up to the 1960s. The railway station has also been restored and now includes 16 buildings and several pieces of rolling stock.