The Arab conquest of Iran, which culminated in the fall of the Sasanian Empire to the nascent Rashidun Caliphate, brought about a monumental change in Iranian society by purging Zoroastrianism, which had been the Iranian nation's official and majority religion since the time of the Achaemenid Empire. Since the Rashidun invasion, Islam (in any form) has consistently held the status of Iran's official religion except for during a short period in the 13th century, when the Mongol invasions and conquests destroyed the Abbasid Caliphate and smaller Islamic realms before resulting in the establishment of the Ilkhanate. The process by which Iranian society became integrated into the Muslim world took place over many centuries, with nobility and city-dwellers being among the first to convert, in spite of notable periods of resistance, while the peasantry and the dehqans (land-owning magnates) took longer to do so. Around the 10th century, most Persians had become Muslims.
Between the 7th century and the 15th century, Sunni Islam was the dominant sect in Iran, and Iranian academics of this period contributed greatly to the Islamic Golden Age. In the 16th century, the newly enthroned Safavid dynasty initiated a massive campaign to install Shia Islam as Iran's official sect, aggressively proselytizing the faith and forcibly converting the Iranian populace. The Safavids' actions triggered tensions with the neighbouring Sunni-majority Ottoman Empire, in part due to the flight of non-Shia refugees from Iran. It is estimated that by the mid-17th century, Iran had become a Shia-majority nation. Over the following centuries, with the state-fostered rise of an Iran-based Shia clergy, a synthesis was formed between Iranian culture and Shia Islam that marked each indelibly with the tincture of the other. Later, under the Pahlavi dynasty, Islamic influence on Iranian society was rolled back in order to assert a new Iranian national identity—one that focused on pre-Islamic Iran by shedding more light on Zoroastrian tradition and other aspects of ancient Iranian society, particularly during the Achaemenid era. However, in 1979, the Islamic Revolution brought about yet another monumental change by ending the historic Iranian monarchy and replacing it with an Islamic republic.