{
 "id": "event/fatimid-mahdi-maghreb",
 "class": "event",
 "slug": "fatimid-mahdi-maghreb",
 "label": {
  "ar": "غلبة المهدي العبيدي على المغرب وخروجه من أمر بني العباس",
  "en": "The Ubaydid al-Mahdi's triumph in the Maghreb and its departure from Abbasid rule"
 },
 "summary": {
  "ar": "في أيام المقتدر غلب أمر المهدي بالمغرب وسلم عليه بالإمامة ودعي له بالخلافة وبسط في الناس العدل والإحسان فانحرفوا إليه ومهدت له المغرب وعظم ملكه وبنى المهدية وهرب أمير إفريقية زيادة الله بن الأغلب إلى مصر ثم أتى العراق وخرجت المغرب عن أمر بني العباس من هذا التاريخ فكانت مدة ملكهم جميع الممالك الإسلامية مئة وبضعاً وستين سنة ومن هنا دخل النقص عليهم، وسار المهدي يريد مصر في أربعين ألفاً من البربر فحال النيل بينه وبينها فرجع إلى الإسكندرية فأفسد فيها وقتل ثم ملكها والفيوم، وعاد القائم محمد بن المهدي فأخذ أكثر الصعيد وملكت جيوشه الجزيرة من الفسطاط {cite:tarikh-khulafa-minhaj-1434 p. 587-590}. وعند المسعودي أخرج أبو عبد الله المحتسب الداعية في كتامة والبربر زيادة الله بن عبد الله من إفريقية سنة ست وتسعين ومائتين ودعا إلى عبيد الله صاحب المغرب، ولم يزل آل الأغلب أمراء إفريقية منذ قلد الرشيد إبراهيم بن الأغلب أمرها بالرقة سنة أربع وثمانين ومائة {cite:muruj-al-dhahab p. 647-648}",
  "en": "Under al-Muqtadir the Mahdi's cause prevailed in the Maghreb: he was saluted as imam and caliph, built al-Mahdiyya, and the Aghlabid amir Ziyadat Allah fled to Egypt then Iraq — 'from this date the Maghreb left the Abbasids' command', after a hundred and sixty-odd years of their rule over all the Islamic realms. The Mahdi marched on Egypt with forty thousand Berbers; the Nile barred him, so he took Alexandria and the Fayyum, while his son al-Qa'im later seized most of Upper Egypt and the Fustat quarter {cite:tarikh-khulafa-minhaj-1434 p. 587-590}."
 },
 "stub": false,
 "wings": [
  "time"
 ],
 "regions": [
  "maghreb",
  "egypt-nile"
 ],
 "periods": [
  "period/abbasid-early"
 ],
 "tags": [],
 "aliases": [],
 "themes": [],
 "span": {
  "earliest": 909.0008008377995,
  "latest": 910.0001368953187
 },
 "display": {
  "start": {
   "edtf": "0909~",
   "hijri": "0296~",
   "calendar": "julian",
   "precision": "year",
   "status": "tradition",
   "derived": true,
   "note": "نحو 296–301؛ التحويل مشتق {cite:tarikh-khulafa-minhaj-1434 p. 587-590}."
  },
  "end": {
   "edtf": "0909~",
   "hijri": "0296~",
   "calendar": "julian",
   "precision": "year",
   "status": "tradition",
   "derived": true,
   "note": "نحو 296–301؛ التحويل مشتق {cite:tarikh-khulafa-minhaj-1434 p. 587-590}."
  }
 },
 "data": {
  "kind": "founding",
  "date": {
   "start": {
    "edtf": "0909~",
    "hijri": "0296~",
    "calendar": "julian",
    "precision": "year",
    "status": "tradition",
    "derived": true,
    "note": "نحو 296–301؛ التحويل مشتق {cite:tarikh-khulafa-minhaj-1434 p. 587-590}."
   }
  },
  "provenance": {
   "layer": "own-research",
   "source": "تاريخ الخلفاء للسيوطي (ط المنهاج 1434هـ/2013م) ص 581–594",
   "generated_by": "Devin (SWE-2 High) from Apple Vision OCR",
   "run": "lib-tarikh-khulafa-batch-33"
  },
  "sources": [
   "source/tarikh-khulafa-minhaj-1434",
   "source/muruj-al-dhahab"
  ],
  "status": {
   "review": "draft",
   "completeness": 2,
   "generated_by": "Devin (SWE-2 High)"
  }
 },
 "prose": {
  "ar": {
   "sections": [
    {
     "heading": "موجز",
     "markdown": "في أيام المقتدر قوي أمر [[person/ubayd-allah-al-mahdi|المهدي]] في المغرب، ودُعي له بالخلافة، وخرجت المغرب عن أمر بني العباس. وهرب [[person/ziyadat-allah-iii|زيادة الله بن الأغلب]] إلى مصر ثم العراق. {cite:tarikh-khulafa-minhaj-1434 p.587-590}"
    },
    {
     "heading": "الرواية",
     "markdown": "يذكر مصدر الخلفاء أن المهدي بسط العدل في الناس، وبنى المهدية، وعظم ملكه. وسار نحو مصر في أربعين ألفاً من البربر فحال النيل بينه وبينها، فرجع إلى الإسكندرية. وأخذ ابنه القائم أكثر الصعيد. {cite:tarikh-khulafa-minhaj-1434 p.587-590}"
    },
    {
     "heading": "رواية المسعودي",
     "markdown": "عند المسعودي أخرج أبو عبد الله المحتسب، الداعية في كتامة والبربر، زيادة الله من إفريقية سنة 296هـ. ودعا إلى عبيد الله صاحب المغرب. وكان آل الأغلب أمراء إفريقية منذ ولّى الرشيد إبراهيم بن الأغلب سنة 184هـ. {cite:muruj-al-dhahab p.647-648}"
    }
   ],
   "frontmatter": {
    "id": "event/fatimid-mahdi-maghreb",
    "lang": "ar",
    "source_lang": "ar",
    "translators": []
   },
   "updated": "2026-10-16"
  },
  "en": {
   "sections": [
    {
     "heading": "Overview",
     "markdown": "In the days of al-Muqtadir the cause of [[person/ubayd-allah-al-mahdi|al-Mahdi]] grew strong in the Maghrib, the caliphate was proclaimed for him, and the Maghrib left the command of the Abbasids. [[person/ziyadat-allah-iii|Ziyadat Allah ibn al-Aghlab]] fled to Egypt and then to Iraq. {cite:tarikh-khulafa-minhaj-1434 p.587-590}"
    },
    {
     "heading": "The account",
     "markdown": "The source of the caliphs says that al-Mahdi spread justice among the people, built al-Mahdiyya, and his kingdom grew great. He marched toward Egypt with forty thousand Berbers, but the Nile came between him and it, so he returned to Alexandria. His son al-Qa'im took most of Upper Egypt. {cite:tarikh-khulafa-minhaj-1434 p.587-590}"
    },
    {
     "heading": "Al-Mas'udi's account",
     "markdown": "According to al-Mas'udi, Abu Abd Allah al-Muhtasib, the propagandist among the Kutama and the Berbers, drove Ziyadat Allah out of Ifriqiya in 296 AH, and called for Ubayd Allah, the lord of the Maghrib. The Aghlabids had been the amirs of Ifriqiya since al-Rashid appointed Ibrahim ibn al-Aghlab in 184 AH. {cite:muruj-al-dhahab p.647-648}"
    }
   ],
   "frontmatter": {
    "id": "event/fatimid-mahdi-maghreb",
    "lang": "en",
    "source_lang": "ar",
    "translators": [
     "Claude Haiku 5.5 (claude-haiku-5-5), draft translation"
    ]
   },
   "updated": "2026-10-16"
  },
  "ur": {
   "sections": [
    {
     "heading": "خلاصہ",
     "markdown": "مقتدر کے زمانے میں [[person/ubayd-allah-al-mahdi|المہدی]] کا معاملہ مغرب میں مضبوط ہوا، ان کے لیے خلافت کی دعا کی گئی، اور مغرب بنو عباس کے حکم سے نکل گیا۔ [[person/ziyadat-allah-iii|زیادۃ اللہ بن الاغلب]] مصر اور پھر عراق کی طرف بھاگ گیا۔ {cite:tarikh-khulafa-minhaj-1434 p.587-590}"
    },
    {
     "heading": "روایت",
     "markdown": "خلفاء کے مصدر کے مطابق مہدی نے لوگوں میں عدل قائم کیا، مہدیہ شہر بسایا، اور اپنی سلطنت کو وسعت دی۔ وہ چالیس ہزار بربریوں کے ساتھ مصر کی طرف بڑھے مگر نیل نے ان کے اور مصر کے درمیان رکاوٹ ڈال دی، تو وہ اسکندریہ کی طرف لوٹ گئے۔ اور ان کے بیٹے القائم نے صعید کا بیشتر حصہ لے لیا۔ {cite:tarikh-khulafa-minhaj-1434 p.587-590}"
    },
    {
     "heading": "مسعودی کی روایت",
     "markdown": "مسعودی کے ہاں ابو عبداللہ المحتسب، جو کتامہ اور بربروں میں داعی تھے، نے سن 296ھ میں زیادۃ اللہ کو افریقیہ سے نکال دیا، اور عبید اللہ، جو مغرب کے صاحب تھے، کی دعوت دی۔ الاغلب خاندان افریقیہ کے امیر اس وقت سے تھا جب ہارون الرشید نے سن 184ھ میں ابراہیم بن الاغلب کو مقرر کیا تھا۔ {cite:muruj-al-dhahab p.647-648}"
    }
   ],
   "frontmatter": {
    "id": "event/fatimid-mahdi-maghreb",
    "lang": "ur",
    "source_lang": "ar",
    "translators": [
     "Claude Haiku 5.5 (claude-haiku-5-5), draft translation"
    ]
   },
   "updated": "2026-10-18"
  }
 },
 "degree": 4,
 "contemporaries": [],
 "updated": "2026-10-22",
 "connections": [
  {
   "to": "person/ubayd-allah-al-mahdi",
   "type": "had_participant",
   "inverse": true,
   "role": "المهدي",
   "sources": [
    "source/tarikh-khulafa-minhaj-1434"
   ]
  },
  {
   "to": "person/ziyadat-allah-iii",
   "type": "had_participant",
   "inverse": true,
   "role": "أمير إفريقية الهارب",
   "sources": [
    "source/tarikh-khulafa-minhaj-1434"
   ]
  }
 ],
 "related": [
  "event/abu-abd-allah-shii-maghreb-288",
  "event/aghlabid-collapse-296",
  "event/death-of-ubayd-allah-al-mahdi",
  "event/fall-of-raqqada-296",
  "person/ubayd-allah-al-mahdi",
  "person/ziyadat-allah-iii"
 ],
 "license": {
  "prose": "CC BY-SA 4.0",
  "data": "CC0 1.0"
 }
}