Ganja Khanate

The Ganja Khanate ( — "Khānāt-e Ganjeh", , "Ҝәнҹә ханлығы", گنجه خنليغى) was a semi-independent Caucasian khanate that was established in Afsharid Iran and existed in the territory of what is modern-day Azerbaijan between 1747-1805. The principality was ruled by the dynasty of Ziyadoglu (Ziyadkhanov) of Qajar extraction as governors under the Safavids and Nadir Shah. Shahverdi Solṭan Ziyad-oglu Qajar became the khan of Ganja in 1554.
Political history.
In the latter part of the 18th century, the Ganja khanate was one of the most economically prosperous polities in the Caucasus, benefiting from the strategic location of its capital on the regional crossroads. For this reason, two politically stronger neighbours, the Kingdom of Georgia and the Karabakh khanate, encroached on the independence of Ganja.
From 1780 to 1783, the Ganja khanate was a condominium of Heraclius II of Georgia (represented by Prince Kaikhosro Andronikashvili) and Ibrahim-Khalil khan Javanshir of Karabakh (represented by the vizier, Hadrat Quli Beg). In 1783, Ganja rose up against its Georgian and Karabakh overlords. Georgians tried to reconquer Ganja at the end of 1784, but the campaign ended unsuccessfully. So did the Georgian invasions in 1785 and 1786. Under Javad Khan's rule from 1785 to 1804, the Ganja khanate grew in economic and political importance. The khans had their own mint in Ganja.
Around the same time, a new strong central authority had been established in mainland Iran by Agha Mohammad Khan. The Ganjavis actively welcomed the new Iranian ruler; not only in the hope for receiving protection but also for gains at Georgia's expense to make up for the losses suffered in the 1780s.
In 1795, Javad Khan of Ganja joined the Iranian expedition against Georgia.
Russian conquest.
During the first Russo-Persian War (1804-1813) Ganja was considered by Russians, who had earlier supported Georgian claim to the sovereignty over the khanate, as a town of foremost importance. General Pavel Tsitsianov several times approached Javad khan asking him to submit to Russian rule, but each time was refused. On November 20, 1803, the Russian army moved from Tiflis and in December, Tsitsianov started the siege preparations. After heavy artillery bombardment, on January 3, 1804, at 5 o'clock in the morning, Tsitsianov gave the order to attack the fortress. After fierce fighting, the Russians were able to capture the fortress. Javad Khan was killed, together with his sons. According to a major study of the military events in the Caucasus by John F. Baddeley:
Ganja was renamed Elisabethpol in honour of Alexander's wife Elisabeth. In 1805 the imperial government officially abolished the khanate and the military district of Elisabethpol was created. Descendants of Ziyad Oglu Qajar dynasty bore the name of Ziyadkhanov in the Russian empire.