Shaki Khanate

The Shaki khanate (, , also spelled as Sheki khanate, Shekin khanate, Shakki khanate) was one of the most powerful Caucasian khanates established in Afsharid Iran, on the northern territories of modern Azerbaijan, between 1743 and 1819 with its capital in the town of Shaki.
History.
The khanate was founded in 1743 as a result of revolt led by Haji Chalabi Khan against Safavid Empire. It was considered one of the strongest feudal states in Caucasus. The capital of the khanate Shaki, the most populated settlement in the state, was destroyed by floods in 1772, subsequently leading to suburbanization of the town and re-population of the countryside.
Starting from the end of the 18th century, Shaki khans sought military assistance from the Russian Empire due to growing tensions with Qajars. As Agha Muhammad Khan re-established Iranian suzerainty over all former Safavid and Afsharid dependencies in the Caucasus around the time of his re-conquest of Georgia, so was the territory of the khanate added as well. In 1805, Mustafa Salim Khan signed a treaty with Alexander I of Russia effectively making Shaki Khanate Russian vassal state which was later only affirmed by the Russo-Persian Treaty of Gulistan in 1813. In 1819, Shaki Khanate was officially abolished and transformed into a Russian province subordinate to the Russian military administration. In 1840, it was renamed to Shaki Uyezd of Caspian Oblast. In 1846, the province was incorporated into Shemakha Governorate, in 1859 into Baku and in 1868 into Elisabethpol Governorate. After the establishment of Azerbaijan Democratic Republic in May 1918, Shaki was part of Ganja province and with the establishment of Soviet rule in Azerbaijan, Shaki was incorporated into Azerbaijan SSR on May 5, 1920.
Geography.
The khanate was subdivided into 8 districts headed by khan's naibs. The seat of the head of state was in the capital Shaki, in the Palace of Shaki Khans, which is one of the tourist attractions in present-day Azerbaijan. It was built circa 1761 by the grandson of Haji Chalabi, Huseyn Khan. The palace of the Shaki khans is considered one of the important historical monuments in Azerbaijan. Agriculture was the basis of Shaki Khanate's economy. The khanate was known for silkworming culture, one that is still practiced today. Located on the left bank of the river Kish, the town of Shaki was originally sited lower down the hill. However, Shaki was moved to its present location after a devastating mud flood in 1772. As the new location was near the village of Nukha, the city became also known as Nukha, until 1960 when it reverted to the name Shaki, after the Scythians.
References.
http://www.baldhiker.com/2012/12/24/azerbaijan-sheki-kahns-palace/