The Fatimid dynasty ruled over parts of North Africa, Egypt, and the Levant from 909-1171 CE. Founded by Ismaili leader Ubayd Allah, the Fatimid dynasty established Cairo as its capital and built al-Azhar mosque, which became an important center of Islamic learning. However, the Fatimid's lost control over their territories due to weakening central authority and the invasion of the Seljuk Turks in the 11th century. The Ayyubid dynasty, founded by Saladin, ruled much of the region in the 12th-13th centuries and ushered in an era of economic prosperity before being replaced by the Mamluks in Egypt and conquered by the