During these delicate negotiations, Mir Mahmoud was advanced to the gates of Derbent, and had laid waste all the neighbouring country in order to cut off all means of subsistence from the Russian army. That part of ancient Hyrcania, now called Ghilan, was reduced to a desert, and the inhabitants threw themselves under the protection of the Russians, whom they looked upon as their deliverers.
In this they followed the example of the sophi himself. That unfortunate prince sent a formal embassy to Peter the Great, to request his assistance; but the ambassador was hardly departed, when the rebel, Mir Mahmoud, seized on Ispahan and the person of his master.
Thamaseb, the son of the dethroned sophi, who was taken prisoner, found means to escape out of the tyrant's hands, and got together a body of troops, with which he gave the usurper battle. He seconded his father's entreaties to Peter the Great for his protection, and sent to the ambassador the same instructions which Shah Hussein had given him.
This ambassador, whose name was Ishmael Beg, found that his negotiations had proved successful, even before he arrived in person; for, on landing at Astracan, he learnt that general Matufkin was going to set out with fresh recruits to reinforce the army in Daghestan. The dey of Baku or Bachu, which with the Persians gives to the Caspian Sea the name of the Sea of Bacou, was not yet taken. The ambassador therefore gave the Russian general a letter for the inhabitants, in which he exhorted them in his master's name to submit to the emperor of Russia. The ambassador then proceeded to Petersburg, and general Matufkin departed to lay siege to the city of Bachu. (Aug. 1723.) The Persian ambassador arrived at the czar's court the very day that tidings were brought of the reduction of that city.
Baku is situate near Shamache, but is neither so well peopled, nor so rich as the latter. It is chiefly remarkable for the naptha, with which it furnishes all Persia. Never was treaty so speedily concluded as that of Ishmael Beg. (Sept. 1723.) Czar Peter promised to march with his forces into Persia, in order to revenge the death of his subjects, and to succour Thamaseb against the usurper of his crown, and the new sophi in return was to cede to him, not only the towns of Bachu and Derbent, but likewise the provinces of Ghilan, Mazanderan, and Asterabath.