The Haram at Mecca and the Ka’ba
'Successive Muslim caliphs and Mamluk sultans were the prime protectors of the Holy Cities of the Hijaz.'
Successive Muslim caliphs, and later the Mamluk sultans, were the prime protectors of the Holy cities of the Hijaz. As a result, they were responsible for all refurbishments and maintenance of the Haram in Mecca as well as the mosque and tomb of the Prophet in Medina. In order to finance these ongoing commitments, the Mamluk Sultan Qaytbay (r. 872–901 / 1468–96) established a wikala in Cairo, the income from which was dedicated to the provision of grain and other charitable donations to the needy living in the vicinity of the Holy Sites of Mecca and Medina.
Wikala (caravanserai) of Qaytbay

Hegira 885 / AD 1480
Mamluk
Cairo, Egypt
Sultan Qaytbay founded this wikala to provide for the poor of Mecca and Medina.