The Maqils entered the Maghreb during the wave of emigration of the Arabian tribes (Banu Hillal and Banu Sulaym) in the 11th century. Their original number was extremely small and has been reported as less than 200 individuals. The Banu Sulaym opposed their arrival and fought them off. They later allied with the Banu Hillal and entered under their protection, which enabled them to wander in the Moroccan Saharan wolds between Moulouya River and the Tafilalet oases. A tiny group of them however stayed in Tunisia, during their westward transit in the Maghreb, and briefly worked as viziers of the victorious Hillalians and Banu Sulaym, who had freshly defeated the powerful Zirids.