Fatamid Dynasty
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 altereed the fabric and makeup of Libyan society. Two tribes from the Arabian Peninsula, the Banu Hilal and the Bani Salim (or Bani Sulaim), were co-opted into migrating to the Meghreb. The Bani Salim 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 concerted to pasture and the new settlers cemented the cultural and linguistic Arabisation of the region.
Tripoli was conquered in 1146 by the Normans of Sicily. In 1158, the supporters of the Almohad dynasty arrived in Tripoli from Morocco and established their authority defeating the christian normans.
An Almohad emir, Muhammad bin Abu Hafs, ruled Libya from 1207 to 1221 and established the Hafsid dynasty, which outlived the Almohads. The Hafsids ruled Tripoli for nearly 300 years. There was significant trade with the city-states of Europe and Hafsid rulers encouraged art, literature and architecture, and gave scholarship priority. In 1321 the Beni Ammar established an independent dynasty there, which lasted (with an interval, 1354–1369, during which two sovereigns of the Beni Mekki reigned) until 1401, when Tripoli was reconquered by Tunis.
Meanwhile, in the Fezzan in the 13th century, King Danama of Kanem (near Lake Chad) annexed territories as far north as the Al-Jufra oases. His Toubou viceroy founded the autonomous Bani Nasr dynasty, which ruled the Fezzan until the 14th century. They were followed by the theocratic kingdoms of Kharijite sectarians, including the Bani Khattab in the Fezzan. In the early 16th century, the Libyan Sahara fell under the control of Muhammad al-Fazi from Morocco who, early in the 16th century, founded the Awlad Suleiman dynasty in Murzuq.
Read more about this topic: History Of Islamic Tripolitania And Cyrenaica