 The Fatimids originated in Ifriqiya (modern-day Tunisia and eastern Algeria).The dynasty was founded in 909 by ʻAbdullāh al-Mahdī Billah, who legitimized his claim through descent from Muhammad by way of his daughter Fātima as-Zahra and her husband ʻAlī ibn-Abī-Tālib, the first Shīʻa Imām, hence the name "al-Fātimiyyūn" "Fatimid".The Fatamids and the Zaydis at the time, used the Hanafi jurisprudence, as did most Sunnis.