# Yahya ibn al-Qasim

Yahya III ibn al-Qasim (Arabic: يحيى الثالث بن القاسم) was an Idrisid ruler of Morocco.

## Life

Yahya was the son of al-Qasim, a younger son of the second Idrisid ruler of Morocco, Idris II (r. 808–828). The family of al-Qasim controlled northern Morocco, with the cities of Tangier, Basra and Ceuta, and for a time in the 860s even the western half of the Idrisid capital, Fes.
Known by the sobriquet al-Miqdam, Yahya was called upon for assistance by the inhabitants of the Qaraqiyyin quarter of Fes when the town was occupied by the Kharijite rebel Abd al-Razzaq. Yahya drove the rebels away, and is traditionally accounted as the eighth Idrisid emir, until his death in 905.
Modern historians on the other hand consider that his rule over Fes is unlikely to have lasted long: his uncle, Dawud, appears to have ruled the city in 877, while numismatic evidence shows that between 880 and 893 the capital was ruled by members of a different branch of the Idrisid dynasty, descending from another uncle, Isa.
Yahya fell in battle in 905 against the forces of a cousin from a different branch of the dynasty, Yahya IV.

## 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 | | | | | | |