The Situation of North Africa
The Normans and Zirids had shared a series of raids and treaties with each other, being both enemies and friends diplomatically and different times. When Genoan and Pisan forces captured the coastal Zirid city of Mahdia (part of modern-day Tunisia) in 1087 CE, they offered the city to the Normans, who surprisingly turned down the offer. This is because the Normans had agreed to a peace treaty between the two powers and recognized their peace with their Muslim neighbors over the opportunity to expand Christianity during a time of crusader zeal. However, this peace wouldn't last forever. A series of famines and civil unrest gave the opportunity for the Normans to conquer the region. What started with the capture of Tripoli (part of modern-day Libya) in 1146 CE resulted in the total control of the remaining Zirid domain and the creation of the Norman Kingdom of Africa in 1148 CE.