Mehdi Qoli Khan Javanshir

Mehdi Qoli Khan Javanshir (مهدیقلی خان جوانشیر; 1763 or 1772–1845) was the last Khan of the Karabakh Khanate, functioning as its head from 1806 to 1822. His only known issue was Khurshidbanu Natavan, a famous Azerbaijani poet.

Early life
Mehdi Qoli Khan Khan was born in 1763 to Ibrahim Khalil, the second Khan of Karabakh, and Khurshid Begum, daughter of Javad Khan and a granddaughter of Shahverdi Khan of Ganja. Although according to a report written by Tsitsianov on November 1805, he was 33 at the time of writing - hence, possibly born c. 1772. He lost half of his nose during a fight against Qajars in his youth.

Career under Ibrahim Khalil Khan
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 due to 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, Mehdi Qoli Khan, would succeed his father. Same year, he was sent by his father to join Tsitsianov's march on Baku Khanate. However, on 19 November 1805, he was sent back to Karabakh as new heir after the death of Mammad Hasan.

Reign
In 1806, Ibrahim shifted his allegiance back to Iran. One of his grandchildren, Ja'far Qoli Agha, whose succession was meant to be assured by the Treaty of Kurekchay and who had his own plans for ruling Karabakh, was frightened and angered by this action. On 2 June, Ibrahim Khalil Khan along with some of his relatives and thirty members of his retinue were killed by a group Russian soldiers under the instigation of Ja'far Qoli Agha and the commander of the Russian garrison. Although Ja'far Qoli Agha had hoped to become the new khan for helping the Russians against his grandfather's "betrayal," they ultimately appointed Mehdi Qoli Khan, due to the support he enjoyed amongst the distinguished figures of Karabakh. Mehdi Qoli Khan consented to abide by the Treaty of Kurekchay on September 22, 1806, when the Russian emperor Alexander I ((r. 1801 – 1825)) officially confirmed him as khan. Kotliarevskii, the new commander of the Russian garrison in Shusha, was forbidden by the Russian commander Ivan Gudovich to meddle in the internal affairs of the khanate because of his high regard for Mehdi Qoli Khan. Although Mehdi Qoli Khan held the title of khan of Karabakh, he was in reality a figurehead, the real authority being held by the Russians.

Following the Iranian victory against the Russians at the Battle of Sultanabad on 13 February 1812, Mehdi Qoli Khan escaped to Shusha. In June 1812, Mehdi Qoli Khan received a farman (royal decree) from Fath-Ali Shah Qajar ((r. 1797 – 1834)) asking him to reaffirm his loyalty and work with him to expel the Russians from Karabakh. In addition to forgiving Mehdi Qoli Khan for his earlier transgressions, Fath-Ali Shah would also install him as Karabakh's governor and work with him to bring back the tribes of Karabakh who had sought asylum in Azerbaijan. Mehdi Qoli Khan, who changed his alliance between Iran and Russia to his greatest advantage like the majority of the khans in the South Caucasus, made the decision to stick by Russia. In an effort to reassure his continuous allegiance to the Russian Empire, he sent Kotliarevskii the farman. The Russo-Persian War of 1804–1813 ended with the Treaty of Gulistan, in which Iran agreed to cede the majority of their holdings in the eastern Caucasus to Russia, including Karabakh. The treaty was signed in Gulistan, a village in Karabakh.

On 21 November 1822, fearing to be punished by the Russians for the initiatives he had made towards the Iranians, Mehdi Qoli Khan 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.

Later life and death
In Iran, Mehdi Qoli Khan was amongst the members of the "war party" or the "hawks", who advocated for war against the Russians. He was later amongst the Iranian soldiers during the Russo-Persian War of 1826–1828. He was finally given permission to go back to Karabakh in 1836, where he lived for the rest of his days collecting a state pension. He died 1845 and was buried in Aghdam.

Awards

 * Order of St. Anne of the 1st class (30 April 1838)

Family
According to Juan van Halen, he maintained an harem of 23 women. His four principal wives were:


 * 1) Khankhanum agha — daughter of Mehrali bey Javanshir
 * 2) Saray khanum — daughter of Ahmed Khan of Qarachor tribe
 * 3) Mahisharaf khanum — daughter of Jafarqoli Khan Donboli, widow of Mammad Hasan agha Javanshir
 * 4) Badir Jahan Begüm (1802–1861) — daughter of Ughurlu Khan of Ganja Khanate (son of Javad Khan)
 * 5) * Khurshidbanu Natavan (1832–1897)