Shamkhal is the title for the rulers of Kumyk people in Dagestan and North-East Caucasus during the 8th-19th centuries. Since 16 century the capital of the Shamkhalate is Tarki, and the state is known as Shankhalate of Tarki.
Title's origin
Arabic version
According to historians V. V. Bartold and M. A. Polievktov, the title "shamkhal" might come from the name of the ruler Shakhbal appointed by Arabs in Kumukh. According to the chronicle with not established authorship Darbandnamah, a brother of caliph Hisham ibn Abd al-Malik, named Moslim, commander of the Muslim forces in Dagestan, capturing Kumukh appointed Shakhbal as its governor. In Tarih-Dagistan, the name shamkhal refers to the name of the first appointee of Arabs in Kumukh, in the mountainous Dagestan. V. Bartold also stated, that the term "Shamkhal" is a later form of the original form Shawkhal, which is mentioned both in the Russian and Persian sources. Dagestani historian Shikhsaidov wrote that the version claiming Arab descent was in favor of the dynasty and clerics. A. Kandaurov wrote that the Arab version was elaborated by the Shamkhals themselves. Also, the title Shamkhals is not mentioned in the works of the Medieval Arabic historians and geographers.
Turkic version
Among the supporters of Turkic version of the creation of the Shamkhalian state is Lak historian Ali Kayaev:Also it was supported by the historian Fahrettin Kirzioglu, the early 20th century historian D. H. Mamaev, Halim Gerey Sultan, Mehmet-Efendi, and others. Dagestanian historian R. Magomedov stated that:Russian professor of oriental studies, the Doctor of Historical Sciences I. Zaytsev, also shared the opinion that the Shamkhalate was a Kumyk state with the capital in the town of Kumuk. While studying works of the Timurid historians Nizam ad-Din Shami and Sheref ad-din Yezdi, Soviet historians V. Romaskevich and S. Volin, and Uzbek historian Ashraf Ahmedov, as well as professor in Alan studies O. Bubenok, call Gazi-Kumuk call the Shamkhalate area as the lands of Kumyks. Ottoman traveler Evliya Çelebi called the Shamkhal "a natural Oghuz". One of the arguments of the Turkic version is that Shamkhals were elected in the way that is traditional for Turkic peoples — tossing a red apple. Ancient pre-Muslim names of the Kumuk inhabitants, as fixed in Khuduk inscription — Budulay, Ahsuwar, Chupan and others — are of Turkic origin. On the graves of the Shamkhals in Kumukh there are Turkic inscriptions, as noted by professor of Caucasian studies L. Lavrov. The grave itself was called by the locals "Semerdalian" after the Khazarcity of Semender; the gravestones there are patterned in a Kipchak style. In the "Maza chronicle" Shamkhals are described as "a branch of the Khan-Hakhan generations". Nizam ad-Din Shami Yezdi in his XIV century Timurid chronicle The Book of Triumph and Sheref ad-din Yezdi mentioned the land as Gazi-Kumukluk, where the suffix "luk" suffi is a Turkic linguistic sign.
The ruler of Andi people Ali-Beg, who founded a new ruling dynasty, also had a title of "Shamkhal". According to the local story, starting from Ali-Beg until Khadjik, the rulers of their land spoke in the "language of the plains", i.e. Kumyk.
Jamalutdin-haji Mamaev in the beginning of the 20th century wrote:According to French historian Chantal Lemercier-Quelquejay, Shamkhalate was dominated by the Turkic Kumyks, and the Lak people hold the honorable title of Gazis. Apart from that, the Shamkhalate had a feudal class of Karachi-beks, a title exclusively related to Mongol-Turkic states. Piano Karpini mentioned from his travels that Khazaria and Lak, even before falling in the hands of the "Western Tatars", belonged to the Cumans.:Vasily Bartold also stated 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. After the resettlement of some Lezginian peoples from Gilan province if 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