 Complete the following phrase:  As early as the 1510s, Tbilisi and the kingdoms of Kartli and Kakheti were made vassal territories of Safavid Iran. In 1522, Tbilisi was garrisoned for the first time by a large Safavid force. Following the death of king shah Ismail I r. 15011524, king David X of Kartli expelled the Iranians. During this period, many parts of Tbilisi were reconstructed and rebuilt. The four campaigns of the king Tahmasp I r. 15241576 resulted in the reoccupation of Kartli and Kakheti, and a Safavid force was permanently stationed in Tbilisi from 1551 onwards. With the 1555 Treaty of Amasya, and more firmly from 1614 to 1747, with brief intermissions, Tbilisi was an important city under Iranian rule, and it functioned as a seat of the Iranian vassal kings of Kartli whom the shah conferred with the title of vali. Under the later rules of Teimuraz II and Heraclius II, Tbilisi became a vibrant political and cultural center free of foreign rulebut, fearful of the constant threat of invasion, Georgias rulers sought Russian protection in the 1783 Treaty of Georgievsk. Despite this agreement, the city was 