In 1115 while Artukid ruler Ilghazi was resting at ar-Rastan on his way north to Diyarbakır, Khir Khan ibn Qaraja, the Seljuk ruler of Homs, attacked his camp and briefly had him imprisoned. Following Saladin's arrival at ar-Rastan in February 1175, the Crusaders under Raymond of Tripoli withdrew from their siege of Homs which was then captured by Saladin, bringing most of Syria under Ayyubid rule. In 1226, during Ayyubid rule, Syrian geographer Yaqut al-Hamawi visited ar-Rastan and wrote that it was "a small and ancient town ... It is now a ruin, but the remains still show what was its former splendor."