 In the 11th century, the Bedouin tribes of Banu Hilal and Banu Sulaym, who originated from Syria and North Arabia respectively, living at the time in a desert between the Nile and the Red Sea, moved westward into the Maghreb areas and were joined by a third Bedouin tribe of Maqil, which had its roots in South Arabia.The vizier of the caliph of Cairo chose to let go of the Maghreb and obtained the agreement of his sovereign.They set off with women, children, camping equipment, some stopping on the way, especially in Cyrenaica, where they are still one of the essential elements of the settlement, but most arrived in Ifriqiya by the Gabes region; Berber armies were defeated in trying to protect the walls of Kairouan.