The Shiite Fatimid dynasty conquered Misr (Egypt) in 972 and set up their caliphate in Cairo. The difficulty of maintaining control of Libya plagued the Fatimids, as it had almost every other authority preceding them. At the beginning of the 11th century, Bulukkin ibn Ziri was installed as the Fatimid governor but he quickly returned Libya to orthodox Sunni Islam and swore allegiance to the Abbasid caliphs in Baghdad. The Fatimid anger at what they considered a gross betrayal profoundly altered the fabric and makeup of Libyan society. Two tribes from the Arabian Peninsula, the Banu Hilal and the Banu Sulaym, were co-opted into migrating to the Meghreb. The Banu Sulaym settled in Libya, particularly in Cyrenaica, while the Bani Hilal spread across North Africa. The Amazigh tribespeople were displaced from their traditional lands, their farmland converted to pasture and the new settlers cemented the cultural and linguistic Arabisation of the region.