 The building was later restored during the reign of Mamluk sultan al-Ashraf Khalil in 1291.According to local tradition, when Tamerlane invaded Syria in the early 15th century, he spared Homs from destruction because it contained the mosque and the mausoleum of Khalid ibn al-Walid, whom he held in great regard in light of Ibn al-Walid's role as a companion of Islamic prophet Muhammad and a commander of the Muslim Arab army that conquered the city of Damascus and Byzantine Syria.Throughout the 17th and 18th centuries, during Ottoman rule, the Dandan family, the most prominent clan of the Arab Bani Khalid tribe, held a stake in the extended revenue shares of the mausoleum and the mosque.