This complex was built between 1242 and 1244 by the last Ayyubid sultan of Egypt, Al Salih Najm Al Din Ayyub, who died defending Egypt against the Crusader attack that was led by Louis IX. His grandfather was the famous Salah Al Din Ayyub, known in the West as Saladin.
It is the first known example of a mausoleum attached to a madrassa, and it was in many ways a trendsetter for the Mamluk buildings that followed, and that can be visited further along the street. The madrassa was also the first to house all four of the Sunni legal schools. The adjoining tomb, where Sultan Ayyub resides, was built by his Turkic wife, Shagaret Al Durr (Tree of Pearls), in 1250, well after the sultan’s death, which she had concealed to keep the French Crusader armies in Damietta from sensing weakness. Shagarat Al Durr managed to defeat the Crusaders, then ruled on as sultana and ushered in the Mamluk era, when the Turkic janissaries took power.