From A History of Iran: Empire of the Mind, by Michael Axworthy (Basic Books, 2016), Kindle Loc. 2546-69, 2585-99:
It is uncertain just when the Safavids turned Shi‘a; in the religious context of that time and place, the question is somewhat artificial. Shi‘a notions were just one part of an eclectic mix. By the end of the fifteenth century a new Safavid leader, Esma‘il, was able to expand Safavid influence at the expense of the Aq-Qoyunlu, who had been weakened by disputes over the dynastic succession. Esma‘il was himself the grandson of Uzun Hasan, the great Aq-Qoyunlu chief of the 1460s and 1470s, and may have emulated some of his grandfather’s charismatic and messianic leadership style. In 1501 Esma‘il and his Qezelbash followers conquered Tabriz (the old Seljuk capital) in northwestern Iran, and Esma‘il declared himself shah. He was only fourteen years old. A contemporary Italian visitor described him as fair and handsome, not very tall, stout and strong with broad shoulders and reddish hair. He had long moustaches (a Qezelbash characteristic, prominent in many contemporary illustrations), was left-handed, and was skilled with the bow.
At the time of his conquest of Tabriz, Esma‘il proclaimed Twelver Shi‘ism as the new religion of his territories. Esma‘il’s Shi‘ism took an extreme form, which required the faithful to curse the memory of the first three caliphs that had preceded Ali. This was very offensive to Sunni Muslims, who venerated those caliphs, along with Ali, as the Rashidun or righteous caliphs. Esma‘il’s demand intensified the division between the Safavids and their enemies, especially the staunchly Sunni Ottomans to the west. Recent scholarship suggests that even if there was a pro-Shi‘a tendency among the Qezelbash earlier, Esma‘il’s declaration of Shi‘ism in 1501 was a deliberate political act.
Within a further ten years Esma‘il conquered the rest of Iran and all the territories of the old Sassanid Empire, including Mesopotamia and the old Abbasid capital of Baghdad. He defeated the remnants of the Aq-Qoyunlu, as well as the Uzbeks in the northeast and various rebels. Two followers of one rebel leader were captured in 1504, taken to Isfahan, and roasted on spits as kebabs. Esma‘il ordered his companions to eat the kebab to show their loyalty (this is not the only example of cannibalism as a kind of extreme fetish among the Qezelbash).
Esma‘il attempted to consolidate his control by asserting Shi‘ism throughout his new domains (though the conventional view that this was achieved in a short time and that the import of Shi‘a scholars from outside Iran was significant in the process has been put into doubt). He also did his best to suppress rival Sufi orders. It is important to stress that although there had been strong Shi‘a elements in Iran for centuries before 1501, and important Shi‘a shrines like Qom and Mashhad, Iran had been predominantly Sunni, like most of the rest of the Islamic world. The center of Shi‘ism had been the shrine cities of southern Iraq.
But Esma‘il’s hopes of westward expansion, aiming to take advantage of the Shi‘a orientation of many more Turkic tribes in eastern Anatolia, were destroyed when the élan of the Qezelbash was blown away by Ottoman cannon at the Battle of Chaldiran, northwest of Tabriz, in 1514. A legend says that Esma‘il vented his frustration by slashing at a cannon with his sword, leaving a deep gash in the barrel.
After this defeat Esma‘il could no longer sustain the loyalty of the Qezelbash at its previous high pitch, nor their belief in his divine mission. He went into mourning and took to drink. Wars between the Sunni Ottomans and the Shi‘a Safavids continued for many years, made more bitter by the religious schism. Tabriz, Baghdad, and the shrine towns of Iraq changed hands several times. Shi‘a were persecuted and killed within the Ottoman territories, particularly in eastern Anatolia where they were regarded as actual or potential traitors. The Safavids turned Iran into the predominantly Shi‘a state it is today, and there were spasmodic episodes of persecution there too, especially of Zoroastrians, Christians, and Jews—despite the ostensible protected status of at least the latter two groups as “People of the Book.” One could make a parallel with the way that religious persecution intensified either side of the Roman/Persian border in the fourth century AD, in the reign of Shapur II, after Constantine made Christianity the state religion of the Roman Empire.
The Safavid monarchs also turned against the Sufis, despite the Safavids’ Sufi heritage. The Sufis were persecuted to the point that the only surviving Sufi order was the Safavid one, and the others disappeared or went underground. In the long term, the main beneficiary of this were the Shi‘a ulema. This was important because the Sufis had previously had a dominant or almost dominant position in the religious life of Iran, especially in the countryside.