History of Tbilisi experienced a constant change of rulers and a continuous struggle of local princes for independence. Sandwiched between the Turks and Persia, which became the prey of Arabs, Mongols, and Tatars, Georgia and Tbilisi tacked between large forces to preserve their identity, culture, and religion. In the 18th century, the Russian Empire joined this cycle. For example, in 1723, under an agreement with Peter the First King Vakhtang the sixth severed relations with Iran. The Persians immediately captured Tbilisi and put the puppet Kakhetian king on the throne. Russia has been left out. Two years later, the Turks came to the rescue. They dislodged the Kakhetians and built a mosque of Juma in support of the Muslims of the city.