of Iran and had been their captive for seven years. Given the weakness of Iran, he made an arrangement with Russia. In September 1722, he advanced on Ganja. When the Russians did not join him, he returned to Tbilisi in November. This provocation of Iran led to a disastrous invasion of his country. Phase Two (1722/23) Before leaving Astrakhan, Peter, on 6 November (17 November N.S.), sent Colonel Shipov and two battalions south to occupy the Iranian city of Rasht at the southwest corner of the Caspian. The locals wanted help against the invading Afghans but quickly changed their minds. 15000 men were gathered, Shah Tamasp ordered the Russians out (February) and towards the end of March the Russians defeated the Iranians, and had decisively taken the Caspian Sea town. After a long siege on 26 June 1723 (7 July 1723 N.S.) General Matyushkin took the Iranian town of Baku and soon Shirvan to the west and then the three Iranian provinces on the south coast of the Caspian Sea. On September 12 (September 23 N.S.), the Russians and Iranians made a treaty in which the Russians would drive out the Afghans and restore Shah Tahmasp to the throne in return for the cession of Derbent, Baku and the three south coast provinces. Next year, Prince Meshchersky went to Iran but was unable to secure ratification and was almost killed. The war was formally concluded by the 1723 Treaty of Saint Petersburg, which recognized the Russian annexation of the west and south coasts of the Caspian. By the 1724 Treaty of Constantinople, Russia recognized Turkish control of nearly everything west of what they had captured, thereby partitioning Transcaucasia between the two powers. The Russians lost many soldiers to disease. At the same time, Nader Shah restored Iranian power. In 1732, through the Treaty of Resht, Russia withdrew to approximately the current Iranian border. In 1735, as a result of the Treaty of Ganja, Russia withdrew to its former border along the Terek River. Aftermath The war was a costly war for both sides in different measures. Iran had lost swaths of its territories, while Russia had suffered large human losses. The campaign proved costly; of the 61,039 men who took part, 36,663 did not return. Grave damage was inflicted by the Russians on the occupied areas. Thus, in Gilan, one of the consequences of the occupation was the rapid decline