quality:correction
Fall of the Safavid dynasty

Nader grew up during the final years of the Safavid dynasty which had ruled Iran since 1502. At its peak, under such figures as Abbas the Great, Safavid Iran had been a powerful empire, but by the early 18th century the state was in serious decline and the reigning shah, Soltan Hoseyn, was a weak ruler. When Soltan Husayn attempted to quell a rebellion by the Ghilzai Afghans in Kandahar, the governor he sent (Gurgin Khan) was killed. Under their leader Mahmud Hotaki, the rebellious Afghans moved westwards against the shah himself and in 1722 they defeated a force at the Battle of Gulnabad and then besieged the capital, Isfahan. After the Shah failed to escape or to rally a relief force elsewhere, the city was starved into submission and Soltan Husayn abdicated, handing power to Mahmud. In Khorasan, Nader at first submitted to the local Afghan governor of Mashhad, Malek Mahmud, but then rebelled and built up his own small army. Soltan Husayn's son had declared himself Shah Tahmasp II, but found little support and fled to the Qajar tribe, who offered to back him. Meanwhile, Iran's imperial neighboring rivals, the Ottomans and the Russians, took advantage of the chaos in the country to seize and divide territory for themselves. In 1722, Russia, led by Peter the Great and further aided by some of the most notable Caucasian regents of the disintegrating Safavid Empire, such as Vakhtang VI, launched the Russo-Iranian War (1722–1723) in which Russia captured swaths of Iran's territories in the North Caucasus, South Caucasus, as well as in northern mainland Iran. This included mainly, but was not limited to, the losses of Dagestan (including its principal city of Derbent), Baku, Gilan, Mazandaran, and Astrabad. The regions to the west of that, mainly Iranian territories in Georgia, Iranian Azerbaijan, and Armenia, were taken by the Ottomans. The newly gained Russian and Turkish possessions were confirmed and further divided amongst themselves in the Treaty of Constantinople (1724). During the chaos, Nader cut a deal with Mahmud Hotaki to rule Kalat in the north of Iran. However, when Mahmud Hotaki began minting coins in his name and asked for everyone's allegiance, Nader refused.