The Maqil (Arabic: المعقل) were an Arabian nomadic tribe that emigrated to the Maghreb region, with the Banu Hillal and Banu Sulaym tribes, in the 11th century. They mainly settled in and around Morocco's Saharan wolds and oases; in Tafilalet, Wad Nun (near Guelmim), Draa and Taourirt. Despite their originally small number (less than 200) they later played a regionally significant role in fighting the Merinids, whereas they were forced to subjugate themselves to their authority at times when the central power of this dynasty was strong. They were also influential in altering the culture of these regions. This, today, mainly manifests in the Hassaniya language which was named after one of their sub-groups.
The exact origin of the Maqil tribe is unknown. They claimed for themselves a prestigious Hashemite descent from Jaafar ibn Abi Talib, son of Abu Talib and brother of Ali ibn Abi Talib. Arabian genealogists categorized them as Hillalians.Ibn Khaldun wrote that both of these versions are false, since the Hashemites lived in urban cities and weren't nomadic nor ever wandered in desert wolds. He added that the Maqil is a name only found in Yemen.
Ibn Khaldun speculated that they were likely an Arab nomadic group from Yemen, and this is supported by Ibn al-Kalbi and Ibn Said.