{
 "id": "polity/idrisid-dynasty",
 "class": "polity",
 "slug": "idrisid-dynasty",
 "label": {
  "ar": "الدولة الإدريسية",
  "en": "Idrisid dynasty"
 },
 "summary": {
  "ar": "دولة الأدارسة بالمغرب الأقصى؛ أول دولة قامت للعلويين بالمغرب لما لجأ إدريس بن عبد الله بن الحسن إلى وليلة فبايعته البرابرة، وقسم ابنه محمد الأعمال بين أولاده فكانت لغمارة والريف ونكور حصص منها، وحاربت دولتهم الأغالبة والعبيديين ثم استجدّ موسى بن أبي العافية فأجلاهم عن فاس سنة 313هـ إلى جبال غمارة وحجر النسر معقلهم، وقام فيهم أبو العيش بن إدريس ثم الحسن بن كنون على بيعة الناصر الأموي فهزم عسكر الحكم سنة 362هـ، حتى طردهم غالب بن عبد الرحمن إلى المشرق وقُتل الحسن راجعاً إلى المغرب، فانقرض ملكهم إلا رجعة بني حمود منهم بسبتة وطنجة.",
  "en": "The Idrisid state of the Far Maghreb; the first Alid polity there, raised when Idris ibn Abdallah took refuge at Walila and the Berbers gave him bay'a — his son Muhammad divided the realm among his sons, Ghumara, the Rif and Nekour among their shares; the dynasty warred the Aghlabids and Fatimids until Musa ibn Abi al-Afiya drove them from Fez in 313 to the Ghumara fastness of Hajar al-Nasr, where Abu al-Aysh ibn Idris and then al-Hasan ibn Kannun led them under Cordoban da'wa (routing al-Hakam's army in 362), until Ghalib exiled them east and al-Hasan was killed returning — Idrisid kingship ended save for the later Hammudid branch at Ceuta and Tangier."
 },
 "stub": false,
 "wings": [],
 "regions": [
  "maghreb"
 ],
 "periods": [
  "period/abbasid-early",
  "period/abbasid-fragmentation",
  "period/buyid-seljuk-fatimid-era"
 ],
 "tags": [],
 "aliases": [],
 "themes": [],
 "span": {
  "earliest": 789.0010746285002,
  "latest": 986.0016975023126
 },
 "display": {
  "start": {
   "edtf": "0789",
   "hijri": "0172",
   "calendar": "julian",
   "precision": "year",
   "status": "tradition",
   "derived": true,
   "note": "مبايعة إدريس الأول بوليلة بعد هروبه من فخ؛ التحويل مشتق.",
   "sources": [
    "source/tarikh-ibn-khaldun-ibar"
   ]
  },
  "end": {
   "edtf": "0985~",
   "hijri": "0375~",
   "calendar": "julian",
   "precision": "year",
   "status": "tradition",
   "derived": true,
   "note": "قتل الحسن بن كنون راجعاً إلى المغرب؛ التاريخ تقريبي.",
   "sources": [
    "source/tarikh-ibn-khaldun-ibar"
   ]
  }
 },
 "data": {
  "kind": "dynasty",
  "start": {
   "edtf": "0789",
   "hijri": "0172",
   "calendar": "julian",
   "precision": "year",
   "status": "tradition",
   "derived": true,
   "note": "مبايعة إدريس الأول بوليلة بعد هروبه من فخ؛ التحويل مشتق.",
   "sources": [
    "source/tarikh-ibn-khaldun-ibar"
   ]
  },
  "end": {
   "edtf": "0985~",
   "hijri": "0375~",
   "calendar": "julian",
   "precision": "year",
   "status": "tradition",
   "derived": true,
   "note": "قتل الحسن بن كنون راجعاً إلى المغرب؛ التاريخ تقريبي.",
   "sources": [
    "source/tarikh-ibn-khaldun-ibar"
   ]
  },
  "external_ids": {
   "wikidata": "Q431575"
  },
  "sources": [
   "source/tarikh-ibn-khaldun-ibar"
  ],
  "provenance": {
   "layer": "own-research",
   "source": "ابن خلدون، العبر — دولة الأدارسة في غمارة، ص1664-1666 (طبعة هيليوبوليس)",
   "generated_by": "Devin (SWE-2 High) from Apple Vision OCR",
   "model": "swe-2-high",
   "run": "lib-ibar-east-19"
  },
  "status": {
   "review": "draft",
   "completeness": 1,
   "generated_by": "Devin (SWE-2 High); extracted from Ibn Khaldun al-Ibar via Apple Vision OCR"
  }
 },
 "prose": {
  "ar": {
   "sections": [
    {
     "heading": "موجز",
     "markdown": "دولة الأدارسة في المغرب الأقصى، وهي بحسب ابن خلدون أول دولة قامت للعلويين بالمغرب. بدأت سنة 172هـ (789م) بمبايعة إدريس بن عبد الله بن الحسن في وليلة. وتؤرخ البيانات نهايتها تقريباً بنحو سنة 375هـ (985م). {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "القيام والتقسيم",
     "markdown": "لجأ إدريس إلى وليلة فبايعته البربر. وقسم ابنه محمد الأعمال بين أولاده، فكانت لغمارة والريف ونكور حصص منها. {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "الحروب والتراجع",
     "markdown": "حاربت دولتهم الأغالبة والعبيديين. ثم استجد موسى بن أبي العافية فأجلاهم عن فاس سنة 313هـ إلى جبال غمارة وحجر النسر، معقلهم. {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "آخر أمرهم",
     "markdown": "قام فيهم أبو العيش بن إدريس، ثم الحسن بن كنون على بيعة الناصر الأموي، فهزم عسكر الحكم سنة 362هـ. حتى طردهم غالب بن عبد الرحمن إلى المشرق، وقُتل الحسن راجعاً إلى المغرب. فانقرض ملكهم، إلا رجعة بني حمود منهم بسبتة وطنجة. {cite:tarikh-ibn-khaldun-ibar}"
    }
   ],
   "frontmatter": {
    "id": "polity/idrisid-dynasty",
    "lang": "ar",
    "source_lang": "ar",
    "translators": []
   },
   "updated": "2026-10-16"
  },
  "en": {
   "sections": [
    {
     "heading": "Overview",
     "markdown": "The Idrisid state in the far Maghrib, which Ibn Khaldun regards as the first state founded by the Alawids in the Maghrib. It began in 172 AH (789 CE), when Idris ibn Abd Allah ibn al-Hasan was given the oath of allegiance in Walila. The data date its end roughly to 375 AH (985 CE). {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "Founding and division",
     "markdown": "Idris sought refuge in Walila, and the Berbers gave him their allegiance. His son Muhammad divided the territories among his sons, and Ghumara, al-Rif and Nukur had shares of them. {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "Wars and decline",
     "markdown": "Their state fought the Aghlabids and the Fatimids. Then Musa ibn Abi al-Afiya arose and drove them out of Fez in 313 AH to the mountains of Ghumara and Hajar al-Nasr, their stronghold. {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "Their last days",
     "markdown": "Abu al-'Ish ibn Idris rose among them, and then al-Hasan ibn Kanun, on the allegiance to the Umayyad al-Nasir, and defeated the army of al-Hakam in 362 AH. Ghalib ibn Abd al-Rahman then drove them out to the east, and al-Hasan was killed on his return to the Maghrib. Their rule died out, except for the return of the Banu Hammud among them in Ceuta and Tangier. {cite:tarikh-ibn-khaldun-ibar}"
    }
   ],
   "frontmatter": {
    "id": "polity/idrisid-dynasty",
    "lang": "en",
    "source_lang": "ar",
    "translators": [
     "Claude Haiku 5.5 (claude-haiku-5-5), draft translation"
    ]
   },
   "updated": "2026-10-16"
  },
  "ur": {
   "sections": [
    {
     "heading": "خلاصہ",
     "markdown": "مغربِ اقصیٰ میں ادارسہ کی ریاست، جو ابن خلدون کے مطابق مغرب میں علویوں کی پہلی ریاست تھی۔ یہ 172 ہجری (789 عیسوی) میں ولیلہ میں ادریس بن عبداللہ بن الحسن کی بیعت سے شروع ہوئی۔ ڈیٹا اس کا خاتمہ تقریباً 375 ہجری (985 عیسوی) بتاتا ہے۔ {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "قیام اور تقسیم",
     "markdown": "ادریس ولیلہ آئے تو بربروں نے ان کی بیعت کی۔ ان کے بیٹے محمد نے علاقے اپنی اولاد میں تقسیم کیے، اور غماره، الریف اور نکور کے حصے اسی تقسیم میں شامل تھے۔ {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "جنگیں اور زوال",
     "markdown": "ان کی ریاست اغالبہ اور عبیدیوں سے لڑتی رہی۔ پھر موسیٰ بن ابی العافیہ نے انہیں 313 ہجری میں فاس سے نکال کر غماره کے پہاڑوں اور ان کے مرکز حجر النسر کی طرف دھکیل دیا۔ {cite:tarikh-ibn-khaldun-ibar}"
    },
    {
     "heading": "آخری دور",
     "markdown": "ان میں ابو العیش بن ادریس کھڑے ہوئے، پھر الحسن بن کنون نے اموی ناصر کی بیعت پر قیام کیا، اور 362 ہجری میں حکم کے لشکر کو شکست دی۔ یہاں تک کہ غالب بن عبدالرحمن نے انہیں مشرق کی طرف نکال دیا، اور الحسن واپس مغرب آتے ہوئے قتل ہوئے۔ یوں ان کی بادشاہت ختم ہو گئی، سوائے بنو حمود کی واپسی کے جو ان میں سے سبتہ اور طنجہ میں رہے۔ {cite:tarikh-ibn-khaldun-ibar}"
    }
   ],
   "frontmatter": {
    "id": "polity/idrisid-dynasty",
    "lang": "ur",
    "source_lang": "ar",
    "translators": [
     "Claude Haiku 5.5 (claude-haiku-5-5), draft translation"
    ]
   },
   "updated": "2026-10-19"
  }
 },
 "degree": 0,
 "contemporaries": [],
 "updated": "2026-10-19",
 "connections": [],
 "related": [],
 "license": {
  "prose": "CC BY-SA 4.0",
  "data": "CC0 1.0"
 }
}