# Yahya ibn Idris ibn Umar

Yahya IV or Yahya ibn Idris ibn Umar (Arabic: يحيى بن إدريس بن عمر) was an Idrisid ruler of Morocco, ruling in Fes from 905 to 922. For the last three years of his reign, he acknowledged the overlordship of the Fatimid Caliphate, until he was deposed by the Fatimid general Masala ibn Habus. He died in exile at the Fatimid capital of al-Mahdiya in 946.

## Life

Yahya IV was the great-grandson of the second Idrisid emir, Idris II, (r. 808–828) by a junior line of the Idrisid dynasty. His uncle Ali ibn Umar had already briefly ruled from the Idrisid capital of Fes in the late 860s, before being driven off by a Kharijite rebellion. Yahya IV made Meknes, to the southwest of Fes, his base.
In traditional accounts, Ali is held to have been succeeded by his cousin Yahya III ibn al-Qasim, who in turn was killed in battle in 905 against Yahya IV's forces. In reality, Yahya III likely did not long rule in Fes and southern Morocco, where members of a third branch of the dynasty, the descendants of Isa ibn Idris II, held sway until c. 893. Yahya IV's family apparently supplanted them, and from 905, according to much later sources, Yahya IV ruled in Fes. The northern parts of Morocco remained under the rule of Yahya III's descendants.
It was during Yahya IV's reign that the Fatimid Caliphate appeared in Morocco, soon after its establishment in 909. The Berber Fatimid general Masala ibn Habus invaded Morocco, defeated Yahya IV in 919 (or 917), and forced the latter to accept Fatimid suzerainty. Three years later (922 or 919/20, accordingly), Masala returned and deposed Yahya IV outright, taking him prisoner and installing a Berber governor under the overall rule of Masala's cousin, Musa ibn Abi'l-Afiya. Musa had Yahya tortured to make him reveal the location of is treasures, before sending him to exile in Asilah. There he remained until 943, when he was sent to the Fatimid capital, al-Mahdiya. Yahya died there three years later.
Fes remained in Fatimid hands until 922 or 928 (the medieval sources differ), when al-Hasan al-Hajjam, a nephew of Yahya III , led a revolt and briefly drove the Fatimids out.

## Genealogy

Idrisid dynasty :
* Emirs of Morocco
* Caliphs of Córdoba
* Emirs of Algericas
* Emirs of Málaga
| | | | | | | | | | | | | | | | | | | | | Abd al-Muttalib ibn Hashim | Abd al-Muttalib ibn Hashim | Abd al-Muttalib ibn Hashim | Abd al-Muttalib ibn Hashim | Abd al-Muttalib ibn Hashim | Abd al-Muttalib ibn Hashim |
| | | | | | | | | | | | | | | | | Abu Talib ibn Abd al-Muttalib | Abu Talib ibn Abd al-Muttalib | Abu Talib ibn Abd al-Muttalib | Abu Talib ibn Abd al-Muttalib | Abu Talib ibn Abd al-Muttalib | Abu Talib ibn Abd al-Muttalib | | | Abdullah ibn Abd al-Muttalib | Abdullah ibn Abd al-Muttalib | Abdullah ibn Abd al-Muttalib | Abdullah ibn Abd al-Muttalib | Abdullah ibn Abd al-Muttalib | Abdullah ibn Abd al-Muttalib |
| | | | | | | | | | | | | | | | | | | | | | | | | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | Ali ibn Abi Talib | Ali ibn Abi Talib | Ali ibn Abi Talib | Ali ibn Abi Talib | Ali ibn Abi Talib | Ali ibn Abi Talib | | | Fatima bint Muhammad | Fatima bint Muhammad | Fatima bint Muhammad | Fatima bint Muhammad | Fatima bint Muhammad | Fatima bint Muhammad | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | al-Hasan ibn Ali | al-Hasan ibn Ali | al-Hasan ibn Ali | al-Hasan ibn Ali | al-Hasan ibn Ali | al-Hasan ibn Ali |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | al-Hasan ibn al-Hasan | al-Hasan ibn al-Hasan | al-Hasan ibn al-Hasan | al-Hasan ibn al-Hasan | al-Hasan ibn al-Hasan | al-Hasan ibn al-Hasan |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Abd Allah ibn al-Hasan | Abd Allah ibn al-Hasan | Abd Allah ibn al-Hasan | Abd Allah ibn al-Hasan | Abd Allah ibn al-Hasan | Abd Allah ibn al-Hasan |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Idris I al-Akbar r. 788-791 | Idris I al-Akbar r. 788-791 | Idris I al-Akbar r. 788-791 | Idris I al-Akbar r. 788-791 | Idris I al-Akbar r. 788-791 | Idris I al-Akbar r. 788-791 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Idris II r. 803-828 | Idris II r. 803-828 | Idris II r. 803-828 | Idris II r. 803-828 | Idris II r. 803-828 | Idris II r. 803-828 |
| | | | | | | Muhammad I r. 828-836 | Muhammad I r. 828-836 | Muhammad I r. 828-836 | Muhammad I r. 828-836 | Muhammad I r. 828-836 | Muhammad I r. 828-836 | | | | | | | | | Umar ibn Idris | Umar ibn Idris | Umar ibn Idris | Umar ibn Idris | Umar ibn Idris | Umar ibn Idris | | | | | | | | | al-Qasim ibn Idris | al-Qasim ibn Idris | al-Qasim ibn Idris | al-Qasim ibn Idris | al-Qasim ibn Idris | al-Qasim ibn Idris | Dawud r. c. 877 | Dawud r. c. 877 | Dawud r. c. 877 | Dawud r. c. 877 | Dawud r. c. 877 | Dawud r. c. 877 |
| Ali I r. 836-849 | Ali I r. 836-849 | Ali I r. 836-849 | Ali I r. 836-849 | Ali I r. 836-849 | Ali I r. 836-849 | Yahya I r. 849-863 | Yahya I r. 849-863 | Yahya I r. 849-863 | Yahya I r. 849-863 | Yahya I r. 849-863 | Yahya I r. 849-863 | Ali II r. 866-? | Ali II r. 866-? | Ali II r. 866-? | Ali II r. 866-? | Ali II r. 866-? | Ali II r. 866-? | | | Idris ibn Umar | Idris ibn Umar | Idris ibn Umar | Idris ibn Umar | Idris ibn Umar | Idris ibn Umar | | | Ubayd Allah ibn Umar | Ubayd Allah ibn Umar | Ubayd Allah ibn Umar | Ubayd Allah ibn Umar | Ubayd Allah ibn Umar | Ubayd Allah ibn Umar | Yahya III r. ?-905 | Yahya III r. ?-905 | Yahya III r. ?-905 | Yahya III r. ?-905 | Yahya III r. ?-905 | Yahya III r. ?-905 | Muhammad ibn al-Qasim | Muhammad ibn al-Qasim | Muhammad ibn al-Qasim | Muhammad ibn al-Qasim | Muhammad ibn al-Qasim | Muhammad ibn al-Qasim |
| | | | | | | Yahya II r. 863-866 | Yahya II r. 863-866 | Yahya II r. 863-866 | Yahya II r. 863-866 | Yahya II r. 863-866 | Yahya II r. 863-866 | | | | | | | | | Yahya IV r. 905-922 | Yahya IV r. 905-922 | Yahya IV r. 905-922 | Yahya IV r. 905-922 | Yahya IV r. 905-922 | Yahya IV r. 905-922 | | | Ali ibn Ubayd Allah | Ali ibn Ubayd Allah | Ali ibn Ubayd Allah | Ali ibn Ubayd Allah | Ali ibn Ubayd Allah | Ali ibn Ubayd Allah | al-Hasan I al-Hajjam r. 928–930 | al-Hasan I al-Hajjam r. 928–930 | al-Hasan I al-Hajjam r. 928–930 | al-Hasan I al-Hajjam r. 928–930 | al-Hasan I al-Hajjam r. 928–930 | al-Hasan I al-Hajjam r. 928–930 | al-Qasim Kanun r. 937-949 | al-Qasim Kanun r. 937-949 | al-Qasim Kanun r. 937-949 | al-Qasim Kanun r. 937-949 | al-Qasim Kanun r. 937-949 | al-Qasim Kanun r. 937-949 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hammud ibn Ali | Hammud ibn Ali | Hammud ibn Ali | Hammud ibn Ali | Hammud ibn Ali | Hammud ibn Ali | Abu al-Aysh Ahmad r. 948-954 | Abu al-Aysh Ahmad r. 948-954 | Abu al-Aysh Ahmad r. 948-954 | Abu al-Aysh Ahmad r. 948-954 | Abu al-Aysh Ahmad r. 948-954 | Abu al-Aysh Ahmad r. 948-954 | al-Hasan II r. 954-974 | al-Hasan II r. 954-974 | al-Hasan II r. 954-974 | al-Hasan II r. 954-974 | al-Hasan II r. 954-974 | al-Hasan II r. 954-974 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Maymun ibn Hammud | Maymun ibn Hammud | Maymun ibn Hammud | Maymun ibn Hammud | Maymun ibn Hammud | Maymun ibn Hammud | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hammud ibn Maymun | Hammud ibn Maymun | Hammud ibn Maymun | Hammud ibn Maymun | Hammud ibn Maymun | Hammud ibn Maymun | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | al-Qasim al-Ma'mun r. 1018-1021, 1023 | al-Qasim al-Ma'mun r. 1018-1021, 1023 | al-Qasim al-Ma'mun r. 1018-1021, 1023 | al-Qasim al-Ma'mun r. 1018-1021, 1023 | al-Qasim al-Ma'mun r. 1018-1021, 1023 | al-Qasim al-Ma'mun r. 1018-1021, 1023 | | | | | | | | | | | Ali al-Nasir r. 1016-1018 | Ali al-Nasir r. 1016-1018 | Ali al-Nasir r. 1016-1018 | Ali al-Nasir r. 1016-1018 | Ali al-Nasir r. 1016-1018 | Ali al-Nasir r. 1016-1018 |
| | | | | | | | | | | | | Muhammad al-Mahdi r. 1035-1048 | Muhammad al-Mahdi r. 1035-1048 | Muhammad al-Mahdi r. 1035-1048 | Muhammad al-Mahdi r. 1035-1048 | Muhammad al-Mahdi r. 1035-1048 | Muhammad al-Mahdi r. 1035-1048 | | | | | | | | | | | Idris I al-Muta'ayyad r. 1035-1039 | Idris I al-Muta'ayyad r. 1035-1039 | Idris I al-Muta'ayyad r. 1035-1039 | Idris I al-Muta'ayyad r. 1035-1039 | Idris I al-Muta'ayyad r. 1035-1039 | Idris I al-Muta'ayyad r. 1035-1039 | Yahya I al-Mu'tali r. 1021-1023, 1025-1026 r. 1026-1035 | Yahya I al-Mu'tali r. 1021-1023, 1025-1026 r. 1026-1035 | Yahya I al-Mu'tali r. 1021-1023, 1025-1026 r. 1026-1035 | Yahya I al-Mu'tali r. 1021-1023, 1025-1026 r. 1026-1035 | Yahya I al-Mu'tali r. 1021-1023, 1025-1026 r. 1026-1035 | Yahya I al-Mu'tali r. 1021-1023, 1025-1026 r. 1026-1035 |
| | | | | | | | | | | | | al-Qasim al-Wathiq r. 1048-1054 | al-Qasim al-Wathiq r. 1048-1054 | al-Qasim al-Wathiq r. 1048-1054 | al-Qasim al-Wathiq r. 1048-1054 | al-Qasim al-Wathiq r. 1048-1054 | al-Qasim al-Wathiq r. 1048-1054 | | | Muhammad I al-Mahdi r. 1047-1053 | Muhammad I al-Mahdi r. 1047-1053 | Muhammad I al-Mahdi r. 1047-1053 | Muhammad I al-Mahdi r. 1047-1053 | Muhammad I al-Mahdi r. 1047-1053 | Muhammad I al-Mahdi r. 1047-1053 | | | Yahya II al-Qa'im r. 1039-1040 | Yahya II al-Qa'im r. 1039-1040 | Yahya II al-Qa'im r. 1039-1040 | Yahya II al-Qa'im r. 1039-1040 | Yahya II al-Qa'im r. 1039-1040 | Yahya II al-Qa'im r. 1039-1040 | Idris II al-Ali r. 1042-1047, 1053-1054/5 | Idris II al-Ali r. 1042-1047, 1053-1054/5 | Idris II al-Ali r. 1042-1047, 1053-1054/5 | Idris II al-Ali r. 1042-1047, 1053-1054/5 | Idris II al-Ali r. 1042-1047, 1053-1054/5 | Idris II al-Ali r. 1042-1047, 1053-1054/5 | Hasan al-Mustansir r. 1040-1042 | Hasan al-Mustansir r. 1040-1042 | Hasan al-Mustansir r. 1040-1042 | Hasan al-Mustansir r. 1040-1042 | Hasan al-Mustansir r. 1040-1042 | Hasan al-Mustansir r. 1040-1042 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Idris III al-Sami r. 1053 | Idris III al-Sami r. 1053 | Idris III al-Sami r. 1053 | Idris III al-Sami r. 1053 | Idris III al-Sami r. 1053 | Idris III al-Sami r. 1053 | Muhammad II al-Musta'li r. 1054/5 | Muhammad II al-Musta'li r. 1054/5 | Muhammad II al-Musta'li r. 1054/5 | Muhammad II al-Musta'li r. 1054/5 | Muhammad II al-Musta'li r. 1054/5 | Muhammad II al-Musta'li r. 1054/5 | Abd Allah ibn Idris | Abd Allah ibn Idris | Abd Allah ibn Idris | Abd Allah ibn Idris | Abd Allah ibn Idris | Abd Allah ibn Idris |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | Muhammad ibn Abd Allah | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Muhammad ibn Muhammad al-Idrisi | Muhammad ibn Muhammad al-Idrisi | Muhammad ibn Muhammad al-Idrisi | Muhammad ibn Muhammad al-Idrisi | Muhammad ibn Muhammad al-Idrisi | Muhammad ibn Muhammad al-Idrisi | | | | | | |