Shaykh Ali Khan or Shikh Ali Khan (; 1778, Quba — 1822, Balakhani) was the last khan of Quba before its annexation to Russian Empire.

Early life 
He was born in 1778 to Fatali Khan and his Armenian wife Saharnaz, sister of a certain Harutyun of Zeykhur. Although some authors suggested that she might be a Georgian. His father died in 1789, leaving his 12 year old son at the care of his brother Ahmad Khan who tasked him with recapturing Salyan from Rudbar magnates next year. However, he had to return to Quba upon learning his elder brother's death in 1791, appointing his 7-year old brother Hasan Khan as governor of Salyan.

Reign 
Upon inheriting the throne, Shaykh Ali sought to restore his father's power in South Caucasus. He sent his envoy Mirza Hasan to Russian general Ivan Gudovich in 1793, renewing his allegiance to Russian Empire. But when Gudovich sent an officer to Derbent and asked khan to sign the terms of his subjection, the khan refused. It turned out that he was only afraid of the approach of Suleyman Khan Qajar, the general of Agha Muhammad Khan Qajar and refused to sign the terms thinking that the Iranian danger was over.

Khan marched on Baku Khanate in 1794, to restore his cousin Mirza Muhammad II to throne. However upon hearing the news from Shaki Khanate that Salim Khan – new khan of Shaki – massacred all children of former khan, including Shaykhali's nephew, marched on Shaki, leaving Mirza Muhammad near Balakhani with a thousand men. He marched on Mustafa Khan of Shirvan who was ally of Salim Khan same year and besieged him in Aghsu. Although he was supported by Dagestani rulers, siege coupled with rainy weather, attrition, lack of supplies and the army became incapacitated. Mustafa khan in return staged a successful sortie forcing Shaykh Ali to retreat.

Soon, the Gazikumukh khan Surkhay II attacked village of Zeykhur, maternal village of Shaykh Ali. However thanks to the intervention of utsmi Ali Bek and qadi of Tabasaran sides signed a truce in the village of Koysu.

Affairs of Derbent 

Agha Muhammad Qajar's arrival in South Caucasus triggered with expedition of Valerian Zubov in 1796, who besieged Shaykh Ali's castle with more than 12,000 soldiers for 2 months. Shaykh Ali hoped for a Qajar or an Ottoman relief to come and thus prolonged the negotiations. He sent an envoy named Haji beg to Ottoman Empire in April, and an emissary named Qadir beg to Agha Muhammad Khan. However Zubov started bombarding the castle on 14 May. The town surrendered just after a week. Zubov arrested Shaykh Ali Khan, while appointing his pro-Russian half-sister Pari Jahan Khanum as head of the Derbent Khanate.

Shaykh Ali however managed to escape to  near Gilgilçay, reached Kumukh asked for troops from Surkhay II to retake Quba. Shaykh Ali and 10,000 strong Gazikumukh armies were defeated by Russian detachment sent under general Sergei Bulgakov. As a result of disastrous battle near Alpan, 1600 Dagestanis died, including Surkhay's son Bayram, as well as councillor Molla Taghi.

Zubov, on the other hand, suspected khan's sister Pari Jahan of helping him and recalled another half-sibling of Shaykh Ali, Hasan Khan from Elisu to govern Quba and Derbent. Hasan was declared new Khan of Quba and Derbent on . However, just 3 days later Catherine II died and situation of Russian troops in Caucasus left under question. In March 1797, Hasan moved his residence to Derbent, afraid of Shaykh Ali. Pari Jahan, meanwhile, agreed to marriage proposal from Mehdi, Shamkhal of Tarki and wed another half-sister Chimnaz to Abdulla beg, son of Ghāzī Rustam of Tabasaran. Hasan soon had to abandon Derbent and flee to Kaitag Utsmiate.

After departure of Russian troops from Caucasus and assassination of Agha Muhammad Qajar on 17 June 1797, Shaykh Ali managed to reconsolidate his dominion over Quba and Derbent and sent his ambassador Manaf beg to Saint Petersburg to put forward claims to Baku Khanate again. New emperor Paul I recognized him as a subject of Russia and dominion over Baku, Mushkur, Salyan and Derbent, as well as sending some supplies to repair Derbent.

He moved to reconquer Salyan (which was lost after Zubov's attack) in 1798 which 4,000 Dargin mercenaries and Russian fishermen. He arrived in February–March of 1799 using fact of the plague in Shirvan, started to extort people. But soon he came under attack from Mustafa Khan, who moved the entire city up north, in its current place. Defeated Shaykh Ali, was forced to retreat to Derbent, where he fell ill. The Gazikumukh khan Surkhay II, using the opportunity, sent an army under his son Nuh bek to Quba, who claimed to be Hasan Khan returning from exile. Meanwhile he camped near Qullar and kept the khanate under control for a month and half. Shaykh Ali khan managed to expel his armies only after support of 10,000 soldiers from Akusha-Dargo Union and Shamkhalate of Tarki and routed him till Chirag. During the campaign khan had to raise additional taxes from population and had to force peasant to host at least one mercenary. Derbent people, which hosted 2,000 soldiers soon rebelled but was put down thanks to efforts of Mirza Muhammad II. This rebellion was followed by a famine in 1799 when the inhabitants had to fight off 400 carts en route from Tarki to Quba bringing food and supplies to capital, accusing khan of debauchery and only thinking for himself. Soon inhabitants started another rebellion under Sultan beg Bayat and forced Shaykh Ali's governor Muhammad Husayn beg Bayat out of the city. As a middle ground, Shaykh Ali accepted his half-sister and Mirza Muhammad's wife Khanbika khanum as hakem of Derbent and Sultan as her deputy.

Soon later in May 1800, she was deposed by the Gazikumukh khan Surkhay II, who together with Tabasaran ghazi and Kaitag Utsmi installed Hasan Khan as the new Derbent Khan. Hasan Khan later executed Sultan beg using a crime he committed as an excuse. Although Shaykh Ali, still ill, later besieged Derbent for 12 days and had few skirmishes to regain the city, nothing came out of it.

Surkhay II heard rumours of Shaykh Ali later and decided to attack Quba and install his puppet Hasan as khan there. Arriving at Zizik, he was persuaded to lay down his arms by Zibunnisa, wife of Shaykh Ali. Using opportunity Shaykh Ali raided Derbent Khanate and forcibly moved population of 9 villages to Quba, depriving Hasan of his tax income. At last on , two brothers signed a truce, acknowledging each other as khans of their respective states. Shaykh Ali again became khan of Derbent upon his brother's death in 1803 of chickenpox.

War of 1804–1813 

Death of Javad Khan in 1804 signalled the start of Russo-Persian War of 1804–1813. He had pro-Qajar tendencies according to Prince Alexander of Georgia. He aided Huseyngulu Khan of Baku together with Surkhay II's son Nuh beg during unsuccessful conquest attempt of Baku by General Irinarch Zavalishin. Having suffered defeat after several battles, the Russians now afraid of Shaykh Ali's reinforcements, boarded the ships and retreated to the island of Sari (near Lankaran) on .

He joined Abbas Mirza's commander Pir Qoli Khan in Baku, 1806. Meanwhile Derbent citizens rebelled against Shaykh Ali Khan and invited lt-general Grigory Glazenap to capture the city, while elders of the city asked for Mehdi, Shamkhal of Tarki to take title Khan of Derbent. Keys of the city was handed over by Alipanah beg Bayat, naib of khan on . Shaykh Ali later also lost Baku, thanks to disgruntled Mirza Muhammad II who joined army of Russian general Sergei Bulgakov in July 1806 and captured Baku on 6 October 1806.

Left alone without any major allies, Shaykh Ali submitted to Russian forces and sent hostages. But at the same time, he drove population to villages and emptied Quba out of its people. Arriving at an empty city, Bulgakov formally annexed the Quba Khanate and appointed Haji beg of Budukh as a naib and provisional governor.

Guerilla warfare 
Now deposed from his post, Shaykh Ali was granted a village to live in but emboldened by Tsitsianov's murder, Shaykh Ali nevertheless visited Akusha-Dargo Union in 1809, calling for a united front against Russians. They kept harassing Russians with 10,000 soldiers until spring.

Soon Shaykh Ali forged an alliance with Surkhay II and threatened neighboring districts. Allies invaded Shirvan Khanate on , but following a response from Mustafa Khan and Russian contingent he escaped to Tabasaran, where his brother-in-law Abdulla bek was ruling ghazi and gathered 5,000 soldiers among Dargins in Akusha-Dargo and recaptured some territory, however the city itself was held by Russians. Eventually, khan was caught up Russians near Shabran, defeated and was forced to escapte to Yersi. 

In September 1809, a congress was held in the domains of Surkhay II, at which Shaykh Ali and Akushan elders were also present. As a result, they decided to attack Quba in 10 days. Attack was success as Russians reported in August 1810 that the inhabitants of Quba and the local beys had gone over to side of Khan. Nevertheless, the khan was defeated again and retreated to Yersi.

Shaykh Ali again surfaced in Tabasaran in October 1811, supported by Avar Khanate, Mehtuli Khanate and Akusha-Dargo Union. Having gathered a detachment of 3,000 horsemen in Akusha, Shaykh Ali took Khuchni and started to plan his next step. Allies defeated a Russian detachment next month near Acaxur. Coalition recaptured all the territory of former Quba Khanate in December 1811 except Zeykhur and Quba city. Shaykh Ali held these territories for 4 months and started to build a new fortress for himself in Kryz. At the end, he was again defeated by colonel Lisanevich near Çiçi and escaped to Akusha Dargo.

Shaykh Ali later had to face new Russian contingent sent against him by Filippo Paulucci under major-general Nikolai Khotuntsov. Sides met near village of Rustov on . Shaykh Ali had 7,000 under his command, being aided by Surkhay II's son Nuh bek, Aslan Khan of Dzhengutay and Qadi Abubekr of Akusha-Dargo. The latter commanded a battalion of the Kherson Grenadiers, a battalion of the 46th Jäger Regiment and Popov's 16th Don Cossack  Regiment - a total of 877 bayonets, with two guns. Khotuntsov attacked the village from three sides and, after a 4-hour stubborn battle, drove out Shaykh Ali to Akhty, captured many prisoners, recaptured 30 banners and more than 350 horses.

Khotuntsov arrived in the village of Kurakh to demand Shaykh Ali from Surkhay II. Surkhay in return demanded his nephew Aslan bek's return. Russians not wanting to give up their ally, stormed the village on December 15, 1811 and defeated allies. As a result, Aslan bek became the ruler of newly created Kura Khanate.

Disheartened Shaykh Ali later moved to Sumbatl, then to Unchukatl to live with his family. He was offered to live in Quba with payments of 10 silver rubles a day by Russian. The offer was rejected because he still wanted to be the Khan.

Shaykh Ali joined Dagestani rulers in their defence against general Yermolov's subordinate Pestel near Bashlykent on 23 October 1818. The allied 20,000 strong army was commanded by Sultan Ahmad Khan of Avars , his brother Hasan Khan of Mehtuli , Muhammad Qadi of Akusha-Dargo Union, Surkhay II with his sons, Shaikh Ali Khan and his brother-in-law Qadi Abdullah of Tabasaran. Shaykh Ali and Abdullah left the alliance for Quba on the 4th day of siege, reportedly after searching for the corpses of Russian soldiers and cutting off ears and hands, having collected a whole bag of them to turn over to Abbas Mirza in return of monetary support to gather more armies.

Shaykh Ali fought against Aleksey Yermolov near Levashi, during his campaign against Akusha-Dargo Union in 1819. After conquest of Akusha, khan left for Arakani with his followers. Yermolov demanded that the inhabitants of Arakani extradite him, but to no avail. Later he moved to Balakhani. 8 Derbent beys were exiled to Astrakhan on suspicion of being allied to Shaykh Ali, one of them being Haji Qasim, father of Mirza Kazembek.

There is no exact data on his death, however, according to some reports, he died either in 1821, or on .

Family 
Shaykh Ali Khan had two wives:

 Zibunnisa Begüm (m. 1795, d. 1816, Baku) — daughter of Malik Muhammad Khan of Baku
 Mulayim Khanum (m. 1805) — was daughter of a certain Muhammad bey of Zeykhur
 Sultan Ahmad (b. 1807)

His grandson Fatali Khan through his son Sultan Ahmad married a Qajar princess and his descendants settled in Ardabil.

References

Sources 

 
 
 
 
 
 
1822 deaths
Khans of Quba
1778 births