The opinion that the survival of Islam itself depended on the use of military slavery was shared by the great Arab historian and philosopher Ibn Khaldun, who lived in North Africa in the fourteenth century, contemporaneously with the Mamluk sultanate in Egypt. In the Muqadimmah, Ibn Khaldun says the following: When the [Abbasid] state was drowned in decadence and luxury and donned the garments of calamity and impotence and was overthrown by the heathen Tatars, who abolished the seat of the Caliphate and obliterated the splendor of the lands and made unbelief prevail in place of belief, because the people of the faith, sunk in self-indulgence, preoccupied with pleasure and abandoned to luxury, had become deficient in energy and reluctant to rally in defense, and had stripped off the skin of courage and the emblem of manhood--then, it was God's benevolence that He rescued the faith by reviving its dying breath and restoring the unity of the Muslims in the Egyptian realms, preserving the order and defending the walls of Islam. He did this by sending to the Muslims, from this Turkish nation and from among its great and numerous tribes, rulers to defend them and utterly loyal helpers, who were brought from the House of War to the House of Islam under the rule of slavery, which hides in itself a divine blessing. By means of slavery they learn glory and blessing and are exposed to divine providence; cured by slavery, they enter the Muslim religion with the firm resolve of true believers and yet with nomadic virtues unsullied by debased nature, unadulterated with the filth of pleasure, undefiled by the ways of civilized living, and with their ardor unbroken by the profusion of luxury.