The religious policy just referred to, which was designed to impose Shia Islam as the sole confession in Persia, naturally created a good deal of bad blood because of the forcible conversion of Zoroastrians, Jews, Christians and relatively small groups of Shia sectarians, but it had positively devastating consequences for the more or less closed Sunni sections of the population. If they lived near the borders, such communities reacted to the pressure of forcible conversion by developing separatist tendencies. This occurred in the Afghan areas of the Safavid empire, and it was there in the region of Zamindavar and Qandahar that the storm gathered which was eventually to cause the downfall of the shah.
The warlike tribe of the Ghalzai had penetrated into these areas, the population of which had been severely reduced during the reign of 'Abbas I with the resettlement of the Abdalls in Herat. The Ghalzai policy of playing off the Persian governor of Qandahar against the Mughal governor in Kabul had so far helped them to overcome considerable difficulties. Inveterate Sunnls as they were, the Ghalzai now attempted to counter Persian religious pressures by treating with India. Initially they had no intention of rebelling against the Persians, towards whom, if anything, they were more favourably inclined than to the Mughals. But a sudden switch in policy occurred when, as a result of an attack by the Baluchls which the commandant of Qandahar proved powerless to resist, Gurgln Khan (i.e. the former King Giorgi XI of Kartlia) was appointed governor-general in May 1704 and dispatched together with his forces from Kirman to Qandahar.
Brutal treatment at the hands of the Georgians now provoked a revolt amongst the Ghalzai. Gurgln Khan suppressed them, took prisoner their leader, the wealthy and influential Mir Vais, and sent him to Isfahan. Although Gurgln Khan had warned that his prisoner was a dangerous man, Mir Vais managed to gain the favour of the shah and even to arouse his suspicion against the governor-general. A few years later he returned to Qandahar a free man and Gurgln Khan was unable to take any action against him. During his long stay in the capital he had gained a deep insight into the abuses of the government and central administration.
In April 1709, when a large proportion of the Georgian troops had left on an expedition in the provinces, Mir Vais staged a carefully planned coup. Surprising the governor-general in a camp outside the fortress, he overpowered and defeated him together with his followers. Later, when the expeditionary force returned, it was unable to retrieve the situation. The man sent to quell the rebellion, Kai-Khusrau, prefect of Isfahan and a nephew of Gurgln Khan, proved unequal to the task.
It took him more than a year and a half even to arrive on the scene although the forces at his disposal — Georgians and Qizilbash, who were joined in Herat by a group of the Abdali tribe, hereditary foes of the Ghalzai — were numerically strong. Despite initial successes, he was brought to a standstill outside the walls of Qandahar, and lack of reinforcements as well as the outbreak of an epidemic amongst his troops forced him to raise the siege at the end of October 1711. As he retreated the pursuing Ghalzai inflicted a crushing defeat which also cost him his life. The next commander to be entrusted with the reconquest of Qandahar, the qiirchl-bashl Muhammad Zaman Khan Shaman, fell ill and died en route in Herat long before his forces could make contact with the enemy.