of Iranians associate themselves with the Shia branch of Islam, the official state religion, and about 5–10% with the Sunni and Sufi branches of Islam.The remaining 0.6% associate themselves with non-Islamic religious minorities, including Bahá'ís, Mandeans, Yarsanis, Zoroastrians, Jews, and Christians.Specifically, Sunni Islam came to rule in Iran after the period Sunni were distinguished from Shi'a through the Ghaznavids from 975 AD, followed by the Great Seljuq Empire and the Khwarazm-Shah dynasty until the Mongol invasion of Iran.Sunni Islam returned to rule when Ghazan converted.In addition to individuals, whole institutions arose – Nizamiyyas were the medieval institutions of Islamic higher education established by Nizam al-Mulk in the 11th century.
From the Islamization of Iran the cultural and religious expression of Iran participated in the Islamic Golden Age from the 9th through the 13th centuries AD, for 400 years.
For Twelvers the lineage of Imams are known as the Twelve Imams.
Of these Imams, only one is buried in Iran – at the Imam Reza shrine, for Ali ar-Ridha who lived from 765 – 818 AD, before any Shi'a dynasties arose in Iran.
Sunnism was the predominant form of Islam before the devastating Mongol conquest, but subsequently Shi'ism became eventually utterly dominant in all of Iran and modern-day Azerbaijan with the advent of the Safavids.
In the history of Shia Islam the first Shia state was Idrisid dynasty (780–974) in Maghreb, a region of north west Africa.
Succeeding Safavid rulers promoted Shi'a Islam among the elites, and it was only under Mullah Muhammad Baqir Majlisi – court cleric from 1680 until 1698- that Shia Islam truly took hold among the masses.