The people of Shusha made it the pearl of the Caucasus, the cradle of our culture, the mugham-singing heart of Azerbaijan
Mehdigulu Khan Javanshir (1763 or 1772–1845) was the last khan of the Karabakh Khanate, functioning as its head from 1806 up to his flight in 1822. His only known successor was Khurshidbanu Natavan – famous Azerbaijani poetess.
Mehdigulu Khan was born as a son of Ibrahim Khalil, the second Khan of Karabakh Khanate, and Khurshid Begum, daughter of Javad Khan and a granddaughter of Shahverdi Khan of Ganja in 1763.
He was sent together with his half-brother Mammad Hasan agha Javanshir in pursuit of his cousin Muhammad bey (son of Mehrali bey) who seized rulership of Karabakh during chaos ensued Agha Muhammad Khan’s death in 1797. In July 1805, he was promoted to major-general by the order of Alexander I, after an agreement between his father and the Russians which stipulated that Russia would recognize him as the ruler (khan) of the khanate, and the confirmation that his son, Mehdigulu, would succeed his father. He was sent by his father to join Tsitsianov’s march on Baku Khanate same year. However, he was sent back to Karabakh upon death of Mammad Hasan on 19 November 1805 as new heir.
After the murder of his father (as well as the murder of one of his wives, his daughter, and his youngest son) in 1806, Mehdigulu Khan was appointed as the Khan of Karabakh by General Ivan Gudovich. His reign started on 13 September 1806 officially with khan travelling to Tbilisi on 11 November, swearing allegiance to Alexander I in presence of Ivan Gudovich. Mehdigulu received royal insignia from Gudovich on the orders of Andreas Eberhard von Budberg on 7 January 1807.
On 21 November 1822, fearing Russia’s punishment for the overtures he had made to the Iranian government, he escaped to Iran, passing via Erivan, Nakhchivan and Sharur. He was given 6000 tomans of pension and received income from Gargar province. The Khanate was subsequently abolished and transformed into a province of the Russian Empire.
However, later on 8 June 1827, Mehdigulu switched his alliance back to Russia thanks to efforts of Ivane Abkhazi and Mirza Adigozal bey. On 7 July 1827 Khan received an annual grant of 4 thousand chervonets and the right to levy taxes from the families who had followed him from Iran by imperial order. He lived near Shahbulag where he met Spanish general Juan van Halen sometime. He died of illness on 14 May 1845 and interred in royal cemetery of Aghdam.