He was the autonomous ruler of Golpayegan (1749–1751) and Isfahan (1750–1751), assuming the title of Vakil-e daulat ("deputy of the state"), with the Safavid prince Ismail III as a figurehead that legitimized his rule.
[1] Ali Mardan and his men eventually reached the Zagros ranges of western Iran, while Ebrahim Mirza was gathering supporters in Isfahan to claim the throne from his brother.
[2] In May 1750, they stormed the gates of Isfahan—its governor Abu'l-Fath and other prominent residents assembled to protect the fortress of the city, but agreed to surrender and collaborate with them after Ali Mardan's reasonable proposals.
[2] Ali Mardan then took the title of Vakil-e daulat ("deputy of the state")[3] as the head of the administration, while Abu'l-Fath maintained his post as governor of Isfahan, and Karim Khan was appointed commander (sardar) of the army, and was given the task of conquering the rest of Iran.
However, a few months later, while Karim Khan was on an expedition in Kurdistan, Ali Mardan began breaking the terms which they had promised the inhabitants of Isfahan—he greatly increased his shakedown on the city, which New Julfa suffered the most from.
[4] Furthermore, he also started having his deputies replaced, whilst extracting heavy tax and numerous riches to keep his army supplied with the equipment and goods they required.
[5] There he became acquainted with Mostafa Khan Bigdili Shamlu, the former diplomat of Nader Shah, who had been in 1746 sent to Baghdad to confirm the Treaty of Kerden with the Ottomans.
A year later, in early 1753, they began assembling an army in Lorestan, and received the support of the Pashtun military leader Azad Khan Afghan.
[6] Furthermore, after doing a thorough check of Sultan Husayn II's background, Ali Mardan and his associates exposed his true identity, and found out that he was in reality not of Safavid descent, but the son of an Azeri man and an Armenian woman.