The growth of local autonomy towards the end of the Aq Qoyunlu period was particularly marked in the regions around the Caspian Sea and the religious leadership provided by the Sufi order of the Safavids in Ardabil enabled an effective challenge to be made to the nominal rulers of Azerbayjan. Seven of the main Turkmen tribes in the area, later known as the Qizil-bash or 'red-heads', joined the Safavids under Isma'il bin Haydar, their thirteen year-old leader, and in 907/1501 occupied Tabriz. The previous year Isma'il's troops had defeated the Shirvanshah and their second victory encouraged the Turkmen tribes to follow the new leader as far south as Baghdad. The growing Ottoman power forced them out of Iraq and Diyabakr but victories over the Shaybanids in Khwarazm enabled Ismail to consolidate his new state from the Euphrates to the Oxus by focussing on the strongly Shi'ite religious teachings of the Safavids. His capital was moved from Tabriz to Isfahan and diplomatic relations were established with the Ottomans' European enemies.
The stability of the Safavid state lasted for a century after Isma'il's death in 930/1524 but by then the rising political power of the Qizil-bash forced `Abbas I to recruit Circassian and Georgian slave soldiers. After the death of Abbas II in 1077/1666 the power of the Safavids waned and fifty years later Afghanistan rebelled and became independent. In 1135/1722 the Afghan rebels invaded Persia and for a few years ruled the country until Nadir, an Afshari from Khurasan, ejected them. He was rewarded by Shah Tahmasp II with the governorship of Khurasan, Kirman, Mazandaran and Sistan, and followed up his success by taking Azerbayjan and Hamadan from the Ottomans.
Eventually Tahmasp was dethroned and in 1148/1736 Nadir became Shah. A strong ruler, he attacked the Mughal rulers of India and acquired large tracts of their territory north and west of the River Oxus. He also modified the intensity of the Shiite doctrine in favour of a version more acceptable so the populace but, becoming repressive in later years, he was eventually murdered in 1160/1747. His death precipitated the disintegration of the Persian empire with Afghanistan and the Indian provinces being lost to the Durranis of Qandahar. Shah Rukh, the last of the Afsharids, held only Khurasan, with Mazandaran controlled by Qajar chieftains, Azerbayjan by an Afghan and southern Persia with a puppet Safavid ruler, Isma'il III supported by an army under Muhammand Karim Zand. Muhammad deposed Isma'il in 1163/1750 and in the next thirty years regained Azerbayjan and Mazandaran, making Persia once more a state to be reckoned with in the, European diplomatic scene. His death in 1193/1779 divided the country with separate rulers in Shiraz and in Isfahan; this allowed the Qajars in Mazandaran to expand. Under Agha Muhammad they took Khurasan from Shah Rukh and by 1209/1786 had driven the last of the Zands out of Persia.
The Qajars established their capital in Tehran and for over a century administered a prosperous and powerful state, strategically placed relative to the Ottoman Empire, France and England but with growing and expansionist Russia in the north. Nadir al-Din, who ruled for almost fifty years, played one power off against the other but in the process his army came under Western economic control and by 1337/1918 Persia was too weak to prevent the world powers fighting each other on Persian soil. A few years later the last Qajar was deposed in favour of the Commander-in-Chief of the army. He established the Pahlavi dynasty.
from "A Handbook of Islamic Coins" by Michael Broome.