After Al-Adil's death in 1218, intense power struggles broke out among his sons and other Ayyubid princes. Between 1229 and 1246, Damascus switched hands regularly and was attacked five times by different Ayyubid armies. During this period, the citadel was only once taken by force—through mining of one of its walls—in 1239. This occurred when the citadel's garrison had been reduced to below the number needed to defend a castle of that size. Following the murder in 1250 of Al-Muazzam Turanshah, the last Ayyubid sultan of Egypt, Damascus was seized by the Ayyubid ruler of Aleppo, An-Nasir Yusuf. He was in control of most of Syria until the arrival of the Mongols.