Amir al-hajj (أمير الحج; transliteration: amīr al-ḥajj, "commander of the pilgrimage", or amīr al-ḥājj, "commander of the pilgrim"; plural: umarāʾ al-ḥajj) was the position and title given to the commander of the annual Hajj pilgrim caravan by successive Muslim empires, from the 7th century until the 20th century. Since the Abbasid period, there were two main caravans, one departing from Damascus and the other from Cairo. Each of the two annual caravans was assigned an amir al-hajj whose main duties were securing funds and provisions for the caravan, and protecting it along the desert route to the Muslim holy cities of Mecca and Medina in the Hejaz (now Saudi Arabia). According to historian Thomas Philipp, "the office of amir al-hajj was an extremely important one", which brought with it great political influence and religious prestige. Given the significance of the Hajj pilgrimage in Islam, the protection of the caravan and its pilgrims was a priority for the Muslim rulers responsible. Any mishandling of the caravan or harm done to the pilgrims by Bedouin raiders would often be made known throughout the Muslim world by returning pilgrims. The leader of the Muslim world, or the ruler aspiring to this position, was required to ensure the pilgrimage's safety, and its success or failure significantly reflected on the ruler's prestige. Thus, "talented and successful Hajj commanders were crucial". In Ottoman times, the importance of successful umara' al-hajj generally rendered them immune from punitive measures by the Ottoman authorities for abuses they committed elsewhere. The main threat to a Hajj caravan was Bedouin raiding. An amir al-hajj would command a large military force to protect the caravan in the event of an attack by local Bedouin, or would pay off the various Bedouin tribes whose territories the caravan had to traverse on the way to the Muslim holy cities in the Hejaz. The procurement of supplies (water and food), and transportation (camels), were also the responsibility of the amir al-hajj, as was securing the funds to finance the pilgrimage.