Al-Qasim Jannun

Al-Qasim Jannun ibn Muhammad (القاسم جنون بن محمد) was an Idrisid ruler in Morocco in 937–949.

Al-Qasim descended from a cadet branch of the Idrisid dynasty: his grandfather, al-Qasim, was a younger son of the dynasty's second ruler, Idris II. At the beginning of the 10th century, Idrisid ruler in Morocco collapsed, amidst civil war between the various branches of the Idrisid family and the rival Abu Sahl family, Kharijite uprisings, invasion by the newly established Fatimid Caliphate, along with the intervention of the Umayyad Caliphate of Cordoba. A complicated power struggle ensued in the 930s. Al-Qasim, who ruled parts of the north of the country, initially sided with the Fatimids against the renegade Fatimid general Musa ibn Abi'l-Afiya. With Fatimid assistance, Ibn Abi'l-Afiya was defeated and killed, allowing al-Qasim to establish an autonomous emirate in the northern parts of the country, in the Rif Mountains and beyond, including Basra, Azayla, and Tangier. Initially under Fatimid suzerainty, after 944 he shifted towards the Umayyads.

On his death in 949, al-Qasim was succeeded by his sons, Abu'l-Aysh and al-Hasan.