Scholars of the Middle Ages have established that in the twelfth and thirteenth centuries, there was an intellectual shift in the Christian polemic against Islam. Whereas in earlier centuries heresiologists defined Islam as pagan, in the high Middle Ages the prevailing opinion emerged that it was instead a heresy. Medieval writers, who drew upon a rich theological tradition dating to the patristic era, sustained and expanded this new perspective. Many of the patristic theological refutations against heretics proved once again useful as groups such as the Waldensians, Albigensians, and others made serious challenges against the dominant orthodoxy. Even though Islam had already been a formidable presence in the Mediterranean—especially since the conquest of the Iberian Peninsula in the early eighth century—in the high Middle Ages the continued expansion of Islam, including its defeat of the Crusaders, was perceived to be an increased threat to Christendom. A corollary development was the greater interest in Islam—mainly to discredit or refute it—by some leading western Christian theologians. One thing is certain: medieval writers were intent on demonstrating the heretical nature of Islamic doctrines and the perversity of Islamic morality. Medieval polemicists, however, resorted to a standard theological weapon to assault Islam, typology. Through typology medieval writers were capable of constructing alleged historical and doctrinal links between Muhammad and two of the most notorious “types” of heresy from early Christianity: Simon Magus and Nicolas of Antioch.