that the Arabic version is a compilation by local historians trying to merge legends with history. The original population of the "Kazi-Kumykskiy" possession, as wrote F. Somonovich in 1796, were Dagestan Tatars (Kumyks). After the resettlement of some Lezginian peoples from Gilan province of Persia, under the rule of Shamkhal, the population mixed, and the power of Shamkhal decreased, and the new population formed their own Khanate independent of the Shamkhal dynasty: and History 16-17th cc. Relations with Russia In 1556 diplomatic relations with the Moscow state were set. The peaceful embassy of shamkhal brought Ivan the Terrible a number of rich gifts, one of which was extraordinary: an elephant, not seen up to that time in Moscow. Shamkhal's envoy to Russia had no success as in 1557 prince Temruk Idar of Kabardia asked Ivan the Terrible to help him against the raids of shevkalski tsar (shamkhal), Crimean khan and the Turks. Ivan the Terrible sent his general Cheremisov who took over Tarki but decided not to remain there. Russian fortresses In 1566 prince Matlov of Kabarda asked the Moscow tsar to put a fortress at the confluence of the Sunzha and Terek. For the construction of the fortress "came princes Andrew Babichev and Peter Protasiev with many people, guns and musket". In 1567 trying to prevent the Russians to build their stronghold at the mouth of the Sunzha, Budai-shamkhal and his son Surkhay were killed on the battlefield as evidenced by their tombstones at the cemetery of shamkhals in Gazi-Kumukh. In 1569 prince Chopan, son of Budai-shamkhal, was elected shamkhal. Territory of Chopan-shamkhal in the north extended beyond Terek river and adjoined the Khanate of Astrakhan. In the west his territory included part of Chechnya up to Kabarda. In the south, territories of Chopan-shamkhal extended "up to Shemakha itself" according to I. Gerber. In 1570 Chopan-shamkhal jointly with Turks and Crimeans undertook an expedition to capture Astrakhan. The city was not taken and the army retreated to Azov but then invaded Kabarda. Despite the demolition of the Sunzha fortress the Russian advance to the Caucasus by the end of the 1580s recommenced. In 1588, the Russian authorities at the mouth of the Terek founded the fortress of Terki, also known as the Terek Fortress. Terki became the main stronghold of the Russian army in northern Dagestan. Alliance with Iran In Persia in the court of the shah, shamkhal had