Saladin and the Ayyubids
When the First Crusade defeated the Fatimid Caliphs and captured Jerusalem in 1099 AD, people in Egypt and Syria gradually decided that the Fatimids were too weak to rule anymore. One of their generals, Saladin (Salah ad-Din ibn Ayyub in Arabic), took over control from the Fatimids and founded the Ayyubid dynasty (ai-YOU-bid).
Saladin, the Sultan of Egypt, was Kurdish, from Tikrit in northern Iraq. He came to Egypt in 1168 as an assistant to his uncle, who was a general and then became the vizier of the last Fatimid caliph. After Saladin's uncle died the next year, Saladin took power for himself. In 1173 Saladin's brother Turanshah conquered Yemen, in the Arabian Peninsula, which gave Saladin control of the very profitable trade from India through the Red Sea. He was a very successful general who followed the Mamluk generals Zangi and Nureddin in taking back most of the territory that had been lost to the First Crusade. Saladin won back Jerusalem in 1187 AD, and built the great wall that surrounds the Old City today. His attitude towards the conquered Christians was unusually kind - unlike the Athenians, who murdered the Melians, or Alexander, who killed the men of Tyre. Saladin let the Christians leave the city and take ships back to Europe again. Other Muslims began to see Saladin as a kind and fair ruler.
Saladin was a Sunni Moslem, so he brought back Sunni worship to Egypt and Syria, even though the Fatimids had been Shiites. He opened a series of madrasas, or schools, which helped to bring Sunni faith to the people, and also spread science and math from the big university in Baghdad to Egypt and Syria. This also brought the Ayyubids closer to the Seljuks in Baghdad. When Saladin died in 1193 AD, he was buried in Damascus, next to the great Umayyad Mosque there.
After his death, Saladin's sons and relatives broke up his empire so they could each have their own small kingdom to rule. There were small kingdoms at Damascus, Aleppo, Hims, Hamat, and Diyar Bakr. But the Ayyubid sultans of Egypt were the richest and so they mostly controlled all the smaller kingdoms. Scholars and preachers like Maimonides and Francis of Assisi visited or lived in Egypt, the richest city of the rich Ayyubid sultanate. When Pope Honorius attacked Egypt in the Fifth Crusade, the Ayyubids fought them off.
The later Ayyubids bought Turkish and Mongol slaves to be their army rather than fighting themselves. These slaves were called the Mamluks. But little by little the Ayyubid sultans had less and less power and the Mamluks got more and more power. In the Sixth Crusade, the Crusaders fought as mercenaries for the Ayyubids against the Mamluks in exchange for control over Jerusalem. Finally in 1250 AD the Mamluks took over Egypt entirely. By 1260 the Mamluks had also taken over most of the other Ayyubid kingdoms.