 After the death of Saladin , his sons contested control over the sultanate , but Saladin 's brother al @-@ Adil eventually established himself as sultan in 1200 and all of the later Ayyubid sultans of Egypt descended from him . In the 1230s , the Ayyubid emirs of Syria attempted to assert their independence from Egypt and remained divided until Sultan as @-@ Salih Ayyub restored Ayyubid unity by taking over most of Syria , except Aleppo , by 1247 . By then , local Muslim dynasties had driven out the Ayyubids from Yemen , the Hejaz , and parts of Mesopotamia . After his death in 1249 , as @-@ Salih Ayyub was succeeded in Egypt by al @-@ Mu 'azzam Turanshah . However , the latter was soon overthrown by the Mamluk generals who had successfully repelled a Crusader invasion of the Nile Delta . This effectively ended Ayyubid power in Egypt and a number of attempts by the emirs of Syria , led by an @-@ Nasir Yusuf of Aleppo , to wrest back control of Egypt failed . In 1260 , the Mongols sacked Aleppo and conquered the remaining territories of the Ayyubids soon after . The Mamluks , who forced out the Mongols after the destruction of the Ayyubid dynasty , maintained the Ayyubid principality of Hama until deposing its last ruler in 1341 . 
