 The Zirids abandoned Kairouan to take refuge on the coast where they survived for a century.Ifriqiya, the Banu Hilal and Banu Sulaym spread is on the high plains of Constantine where they gradually choked the Qal'a of Banu Hammad, as they had done Kairouan few decades ago.From there, they gradually gained the upper Algiers and Oran plains, some were taken to the Moulouya valley and in Doukkala plains by the Caliph of Marrakesh in the second half of the 12th century.