The shamkhals submitted to Russian authority more than once, first in the early 17th century. In 1668, the town was sacked by cossacks under Stepan Razin. The shamkhals were again obliged to submit to Russian suzerainty during Peter the Great's 1722 Persian Expedition and during Catherine the Great's 1796 Persian Expedition.