As the Persian empire weakened in the second decade of the 18th century, both the Ottomans and the Russians sought to take advantage, invading what is now known as the Caucasus from the West and the East, respectively. The Ottoman Turkish advance into what is now Azerbaijan frequently took on the form of genocidal religious war of Sunni Ottomans and their Dagestani allies against Turkic Shiites (Azerbaijanis). Christians and Jews were also harassed and forcibly converted to Sunni Islam.

Both Armenians and Shiites looked to Russia for relief. In a letter penned in 1724, Armenian lords of mountainous Karabakh proposed to the Shiite khan of Ganja, as fellow allies of Russia, to jointly oppose the Ottomans. The text of the offer had been published in 1950s and translated by Cavid Aga:

“On 21 March 1724, we – the Armenian people of the Karabakh country, [together with] the patriarchs, big and small commanders, Meliks (princes), elders and village chiefs, made Ivan Karapet our authorized Elchi (envoy). Having informed him of the quarrel that existed between us and the Ganjan people, we asked him to reconcile us, since Elchi-bek (Ivan Karapet) wrote a letter to Ganja’s elders and youngers and they replied with a letter to Elchi-bek and said that they are also subjects of the [Russian] Tsar. For this reason, I – Patriarch Esai [Hasan Jalalian of Gandzasar], I – Patriarch Nerses [of Yerek Mankunk], I – Avan Yuzbashi, and I – Mirza Yuzbashi, and I – Tarkhan Yuzbashi, and I – Sarkis Yuzbashi, and I – Abraham Yuzbashi, and I – Melik-Tamraz, and I – Melik-Baghir, and I – Melik Grigor, and I – Melik-Daniel, and I – Melik-Yegan, with our subjects, elders and village chiefs, gave the following letter to Elchi-bek to reconcile us with the Ganjans, so that the friendship and love would be established between us and Ganjas, and we rely upon each other. At the same time, we commit ourselves henceforth, if the Ottoman forces or Lezghins attack Ganja, we, the entire Armenian people, and we, the aforementioned, will come to the aid of Ganja, since the Ganjans are also subjects of our Tsar. And if the Ottomans or Lezghins attack us, Ganjans must come to our aid. And if, we, Armenians, continue to deceive the Ganjans or kidnap, kill or rob one or many Ganjans, then our life and property will be at the disposal of the Tsar.”

Within a decade the Persian empire recovered and regained the territories lost to the Ottomans and Russians.