Shamakhy Khanate
Shamakhy khanate was a feudal state on the modern territory of Azerbaijan in the 18th century. Diarchy existed in Shamakhy khanate. Part of the khanate was governed by Mahammad Hasan khan, other parts was governed by Mahammad Said and Agasi brothers. Mahammad Said khan unified Shamakhy khanate in 1763 and Shamakhy city became the centre of khanate. In 1767, Guba and Shaki khanates attacked the Shamakhy and territory of the khanate was divided between them. In 1790, Shirvan khans restored their authorities.