Javanshir clan

The Javanshirs (Cavanşirlər; – Javānširān) are a Turkic clan from Karabakh, who are a branch of the Oghuz Turks. Between 1748 and 1822, members of the Javanshir clan functioned as the head of the Karabakh Khanate.

Early years
The greater Javanshir tribe is said to of came from Turkestan, as Reza-Qoli Khan Hedayat wrote in his book Rozvat-us-Safa, "the Javanshir elat came from Turkestan and belonged to the tribe of Oshir (Afshar) Khan, who was son of Ildyz Khan, the fourth son of Uguz (Oghuz) Khan. The Javanshir tribe joined the 120-thousand-strong army of Hulagu khan. Under Emir Timur, they came back from Rûm for the second time and spread across Turkestan, Kandahar, Kabul, and Iran. One of its branches led by Ibrahim Khalil Agha, who served Shah Abbas I, remained in Karabakh." Under the rule of Safavid Iran, the Javanshirs vied with the Qajars and other Qizilbash tribes over the influence in Karabakh. In the course of the Turco–Persian wars, the Javanshirs subordinated the Ottomans in 1589. In retaliation, in 1612–1613, Abbas I of Iran induced the Qajars to kill the Javanshir leaders. In 1626–1627, the Javanshir clan was placed by the shah under the stewardship of Nowruz Beg, a Georgian from the Tulashvili clan and a brother-in-law of Davud khan Allahverdi, who was invested with the governorship of Karabakh.

Creation of the Karabakh Khanate
Panah Ali Khan, forefather of the dynasty and founder of the Karabakh Khanate, was a representative of an ancestral aristocracy of a Turkic tribe called Javanshir. After Nader Shah's accession to power in Iran, he was called for a service by him, but after several years, in 1738, he was forced to escape from Khorasan to the North, Shaki and Shirvan, with a group of supporters.According to Mirza Adigozal-bey, Nader Shah replaced murdered Fazl Ali-bey with his younger brother, “handed him the chomak (staff), clad him in the clothes of an eshik-agasy, and conferred on him the rights of his dead elder brother;” Mirza Adigozal-bey believed that Panah Ali-bey found it undignified to “carry the chomak, bow to Nader Shah, and talk to his osauls.” Due to Nader Shah killing his brother, he went off to plunder wealth with his tribesmen and went into hiding.

Murder of Nader Shah in the result of conspiracy led to collapse of the state established by him. Taking advantage of the central power's weakening, Panahali khan, with his detachment consisting of 200 riders, arrived Karabakh, and declared himself an independent khan. At that time, Otuziki, Javanshir and Kebirli tribes, which were forcibly evicted to Khorasan, returned to Karabakh. Elder son of Panahali khan - 15 years old Ibrahim Khalil Khan also escaped from Khorasan to Karabakh, to his father.

Strengthening of Panah Khan didn't suit his neighbors’ taste. Haji Chalabi Khan of Shaki drove a newly appeared khan out of Karabakh in that very year, but next year Panahali Khan returned with a strong detachment and destroyed Haji in a stubborn struggle. After this, all Turkic tribes of Karabakh recognized Panahali Khan's power. Turkic tribes Otuziki, Javanshir and Kebirli dwelling in low-lying regions, became a kernel of the Karabakh Khanate. The khanate occupied a significant territory and included low-lying and also mountainous parts of Karabakh. Initially, a residence of khan was Bayat Castle, constructed in 1748. Later the ruler moved to Shahbulag Castle, near modern day Aghdam. In 1751, unapproachable Panahabad fortress, built by Panah Khan, became the capital of the khanate.

Ibrahim Khalil Khan
After Kerim khan overrode the whole Iran, he called Panahali khan to Shiraz and made him his counselor and his son charged Mehrali bey with ruling Karabakh. In 1759, Panahali khan died in Shiraz. Mehrali bey finished strengthening of Shusha and built new fortresses called Asgaran and Agh-oghlan. Soon he was treacherously murdered by Aghasi khan of Shirvan, after which Ibrahim Khalil Khan-elder son of Panahali khan – asserted himself in Karabakh. His reign began from overriding of fallen meliks, which was lasted till 1787. In that very year, Ibrahim Khalil Khan attempted to conquer Shamakhi, but was defeated by Fatali khan of Quba.

In 1795, Ibrahim Khalil Khan, who didn't want to obey Agha Mohammad Khan who conquered whole Iran until then, sent his ambassadors to Russian empress Catherine II to ask for the Russian citizenship. Knowing about these discussions, Agha Mohammad Khan gathered a great army with overall strength of 85 thousand people, went over the Aras River and approached Shusha, in 1795. Ibrahim Khalil Khan, who had only 15 thousand soldiers under his guidance, defended desperately. Siege of the fortress lasted for 33 days, but due to selfless actions of defenders of the fortress, who were ruled by Ibrahim Khalil Khan and his vizier, eminent poet Molla Panah Vagif - Agha Mohammad Khan couldn't conquer the fortress and he was forced to call a siege off. He ordered to devastate outskirts of the country. After their departure Karabakh burst into starvation.

In 1797, Agha Mohammad Khan invaded Karabakh again. Until then, situation of the Karabakh Khanate was extremely difficult: starvation and plague were rife and rampant in the country and many of the citizens of Karabakh were forced to move to other khanates looking for bread. Withstanding of the second siege was impossible and Ibrahim Khalil Khan left the city and escaped to Dagestan with his family. But after conquering Shusha, Agha Mohammad Khan was murdered by his servants and losing its leader the Iranian army left Karabakh. Ibrahim Khalil Khan came back to Shusha and ruled there for several years as a fully independent ruler. He tried to support good relations with Fathali Shah - a new ruler of Iran, nephew of Agha Mohammad Khan. But this peace was not durable.

Ceding to Russia
Not severing relations with the khan, the shah attempted to bring its garrison to Shusha. In May 1805, Ibrahim Khalil Khan renewed discussions with Russia and moved to Russian citizenship. An agreement was later reached, by which Ibrahim Khalil Khan was allowed to continue to rule the khanate, and his son Mehdiqoli khan Javanshir would be confirmed as his successor. Ibrahim Khalil Khan was obliged to pay an annual tribute of 8,000 chevrons, and allowed the Russian garrison to enter Shusha. He hoped that hereby he will be able to save his government from capture of neighbor states, but he precipitated its end. In the spring of 1806, when the Iranian army consisting of 20 thousand soldiers arrived at Shusha, lieutenant-colonel Lisanevich, commander of the Russian garrison, ordered 80-years-old Ibrahim Khalil Khan for suspicion and betrayal and annihilated all his family (including of his wives and a lot of little children). Russian Government announced Mehdigulu khan Vafa, the son of Mehdiqoli khan Javanshir, as the new khan, but he didn't forgive the Russians and was a secret ally of Iran during the time of his reign.

Meanwhile, in 1813, at the end of the Russo-Iranian war of 1804–1813, the first of the two major Russo-Iranian treaties of the 19th century—known as the Treaty of Golestan—was signed in the Golestan fortress of Karabakh. Per the treaty, the conversion of the Karabakh Khanate to Russia was recognized and Qajar Iran was forced to officially cede it alongside much of its other Caucasian territories comprising modern-day Georgia, Dagestan, and most of the contemporary Republic of Azerbaijan.

In November 1822, fearing the wrath of the Russians for the overtures he had made to the Iranian government, he escaped to Iran, so hastily that he even forgot the state seal in Shusha. In 1822, the Karabakh Khanate was abolished and reformed into a province of the Russian Empire.

The Iranian government didn't put up with losing Transcaucasia and southern Dagestan. Urging on by Great Britain, it soon began a new war against Russia. The Iranians did not succeed to conquer Shusha, which was desperately defensed by the Russian garrison of lieutenant-colonel Reutt, and were eventually driven out.

Dynasty

 * Panah Ali Khan (1693–1758/63)
 * Mehrali Bey (1759/63)
 * Ibrahim Khalil Khan (1759/63–1806)
 * Mehdiqoli khan Javanshir (1806–1822)

Prominent members of the dynasty were Jafargulu agha Javanshir, Mammad Hasan agha Javanshir, Khurshidbanu Natavan, Behbud Khan Javanshir, and others. Descendants of the dynasty are spread throughout Azerbaijan, Iran, Russia, and America.