As we have already seen, Tahmasp Mlrza (b. 1704), appointed crown prince by Sultan Husain, succeeded in breaking through the Afghan lines during the siege of Isfahan and managed to reach Qazvln. There, as early as 30 Muharram 1135/10 November 1722, he had himself proclaimed shah, had the style of Shah Tahmasp II included in official prayers and on the coinage, and issued decrees (arqdm) in all parts of the country, announcing his accession to the throne. Although his was only a nominal rule, he reigned in fact for a good ten years.1 In addition to Tahmasp, another prince, Mirza Sayyid Ahmad, son of Shah Sulaiman's eldest daughter, had managed to escape. In 1139/1726 he rose to the level of ruler in Kirman and proved to be a serious opponent in combats with the forces of both Tahmasp II and the Afghans. He did indeed constitute a greater threat to the Afghans than Tahmasp, and accordingly received more attention from them. Eventually he was defeated and brought as a prisoner to the Afghan chieftain, who had him executed in 1140/1728.
In foreign affairs, the greatest threat to Persia after the abdication of Sultan Husain came from Russian and Ottoman designs on territory in the Caspian provinces and the north-west of the country respectively. Russian troops were already present in Darband and other places on the shores of the Caspian Sea. The Ottomans, for their part, were not slow to act. Sending a declaration of war in 1135/1723, they marched troops into Georgia and — via Kirmanshah and Hamadan — into Persia itself. The policy of Tahmasp II, who had been forced to withdraw from Qazvln to Tabriz by the Afghans, from there to Ardabll by the Turks and ultimately via Ray to Mazandaran, again by the Turks, was dictated by the notion that his position at home would be consolidated if only the Russians and Ottomans could be induced to recognise him as the legitimate ruler of Persia. With this in mind he had sent negotiators to Istanbul and St Petersburg. As a result the Porte changed its view in his favour, but in a treaty for the division of western Persia, concluded by the Sultan and the Tsar for 2 Shawwal 1136/24 June 1724, the two powers merely expressed a desire to help the shah to achieve "his legitimate rights". Moreover, he was to restrict himself to the territory in the west of the country, defined by the places Ardabll, Sultaniyya and Qazvin.
Tahmasp II's first vakil al-daula was Fath 'All Khan Qajar. He was followed by Nadr Qull Beg Afshar, a particularly capable military commander who successfully fought the Afghans and the Turks on his behalf and subjugated Azarbaljan, Georgia and most of Armenia. In other respects, too, he did everything to gain the shah's favour. In 1138/1726 he had conferred upon him the title Tahmasp Qull ("servant of Tahmasp") and by driving out the Afghan Ashraf he even made it possible for the shah to return to Isfahan. It became increasingly clear, however, that the weak and unreliable shah was incapable of being anything more than a puppet in the general's hands, and when he suffered a heavy defeat in a battle with the Turks the latter's patience came to an end. He exposed the shah publicly as a drunkard and dethroned him.