Historic map of Tripoli by Piri Reis... According to al-Baladhuri, Tripoli was...taken by the Muslims very early after Alexandria, in the 22nd year of the Hijra, that is between 30 November 642 and 18 November 643 AD. Following the conquest, Tripoli was ruled by dynasties based in Cairo, Egypt (first the Fatimids, and later the Mamluks). For some time it was a part of the Berber Almohad empire and of the Hafsids kingdom. It was part of the Ottoman Empire between the 16th and 19th centuries.