The Safavid conversion of Iran from Sunnism to Shiism took place roughly over the 16th through 18th centuries and made Iran the spiritual bastion of Shia Islam against the onslaughts of Sunni Islam.
It also ensured the dominance of the Twelver sect within Shiism over the Zaydiyyah and Ismaili sects, marking one of the most important turning points in the history of Islam. As a direct result, the population of the territory of present-day Iran and neighboring Azerbaijan were converted to Shia Islam at the same time in history.
The Safavid dynasty (1501–1736) was Persian and not from Iranian origin.
Iran’s population was mostly (90%) Sunni of the Shafi`i and Hanafi legal rites until the triumph of the Safavids (who had initially been Shafi`i Sufis themselves). Ironically, this was to the extent that up until the end of the 15th century the Ottoman Empire (the most powerful and prominent Sunni state and future arch-enemy of the Shia Safavids) used to send many of its Ulema (Islamic scholars) to Iran to further their education in Sunni Islam, due to a lack of Madrasahs (Islamic schools) within the Empire itself.
All the sects of Islam appeared after a very long time, more than a hundred years, from the Great Islamic civil war “First Fitna” (during 656 – 661 AD) that wrecked the original Islam . And, all of them appeared under unjust cruel rulers many of them colonizer monarchies unacceptable by the original teachings of Prophet Mohamed (pbuh).