There were only a few occasions in Islamic history where Shiites had the opportunity to exercise control over others. Both Buyids and Fatimids adopted a lenient policy regarding the Sunnis, presumably not least for pragmatic reasons since Sunnis constituted the majority of Muslims under their rule. While the Buyids faced the additional difficulty of having no connection with the house of the Prophet and thus acting with the Shiite patronage to a certain extent against their own interests, the Fatimids represented a minority version of Shiism that was highly esoteric and elitist. Their ceremonies thus took place within a restricted area. Yet, the Fatimids and other Ismaili movements remained activist and tried to expand their territories with the ultimate aim of challenging the Abbasid caliph. It was in Iraq, after all, where the movement had started.
The Safavids followed a very different strategy. They originated as a Sufi order in a milieu in eastern Anatolia, Iraq, and Iran shaped by extreme Shiism, Sufism, and pre-Islamic Turco-Iranian traditions. When the order, which was named after a 13th-century shaykh, began to spread at the beginning of the 14th century, it was still a Sunni religious movement. In the second half of the 15th century, the order had started to acquire political power and found its main supporters among the Qizilbash (Ottoman Turkish for 'red heads', a reference to their red headwear), extreme Shiites in eastern Anatolia. In the 15th century the order took on more and more Shiite traits and was marked by extreme notions such as the divinity of their leader. These elements were given up in favor of Twelver Shiism when at the beginning of the 16th century, the Safavids quickly conquered large parts of Iran. Chaldiran, the site of the battle against the Ottomans in 1514, marked the border between Shiite Iran and the Sunni Ottoman Empire, which coincides with the border between the modern states, the Islamic Republic of Iran and the Turkish Republic.
As the character of Safavid Shiism transformed from a charismatic, eschatological nature, into a more traditional kind of Shiism, the Shahs (rulers over Iran) relied to a large extent on scholars, even though the ruler maintained the superior religious authority. Since Shiism was not well enough established in Iran, the Safavid Shahs imported scholars from Lebanon and the Gulf region, although the extent of this emigration is controversial. Shiism in Lebanon can be traced back to the 14th century when a certain Ibn Makki al-Amili, who had studied with a son of the rationalist scholar the Allama al-Hilli, returned to his native Jabal Amil. With the scholars who came from Lebanon, the theoretical concepts of the Allama were introduced in Iran where they strengthened the position of the scholars.
Exceptionally for Islamic history, the Safavids persecuted non-Imami Muslims. This included the extreme Shiites who had initially supported the movement as well as Sunnis and non-Muslims and eventually the Sufi orders. The Sufi saints with their charismatic authority were rivals to the Shiite Imams in whose names the Safavids ruled. This rivalry had a material dimension too, since both benefitted from taxes and donations. There were further waves of such persecutions in Iran even after Safavid rule had ended.
The end of Safavid rule in 1736 allowed the scholars to consolidate and further expand their authority. No dynasty that could claim descent from the house of the Prophet rivaled them. In the course of assuming more and more power, the scholars also claimed what had been prerogatives of the Hidden Imam, among other things, to lead the Friday prayer, to declare jihad, and to excommunicate (takfir, i.e., to declare someone an unbeliever).