With the arrival of Russia in Karabakh at the beginning of the 19th century, a new political situation arose. The policy of Russia, directed toward the establishment of a social-ethnic base in the form of Armenians, led to the strengthening of the Christian element in Karabakh. The essence of the disputes observed today, have roots that reach precisely to those times. Having finally conquered Georgia in 1801, Russia moved toward the borders of Azerbaijan. General P.D. Tsitsianov, who commanded Russian forces in the Caucasus, laid siege to Ganja, the largest of the cities of Azerbaijan, in March 1803. Having overcome the serious resistance of the population led by Javad-khan, Russian forces entered the city on January 3, 1804. In order to strengthen his position in the Transcaucasus, Tsitsianov had to conquer the Karabakh, Sheki, and Shirvan khanates, which were considered the strongest in this region. During the course of long negotiations, Tsitsianov threatened these khanates, demanded that they consider the sad experience of Ganja and, taking into consideration the military might of Russia, accept its protection without resistance. In doing so, Tsitsianov understood perfectly well that Iran had interests in the region and therefore did not push events. Moreover, he had to consider the far from small military potential of the Muslim khanates themselves.
Finding himself constantly “between the hammer and the anvil” (Russia in the North and Iran in the South), Ibrahim Khalil-khan, the ruler of Karabakh, decided to conclude with Russia “a solemn promise,” a treaty which in fact became the first legal document on the path of the joining of Karabakh to Russia. The treaty between the Karabakh Khanate and the Russian Empire about the transition of the khanate under the power of Russia was signed on May 14, 1805 in the military encampment at Kurakchay, and therefore it passed into history as the “Kurakchay Treaty.” The document consists of 11 articles and gives Russia a one-sided primacy. From then on, the Karabakh Khanate passed under the protection of Russia and rejected any attempt at independent international ties with third countries. More than that, it was especially noted that the Karabakh Khanate lost the right of independent communication with the neighboring khanates. And the Karabakh khan was also obligated to contribute to the Russian treasury every year 8,000 chervontsy (24,000 Russian rubles) and also to pay for the expenses of his grandson who was kept in Tiflis in the residence of the commander in chief as a hostage. One of the most difficult conditions of the treaty was an agreement on the dislocation in the Shusha fortress of 500 Russian soldiers with cannon.
The only article of the Kurakchay Treaty, which could be considered as favoring Ibrahim Khalil-khan, was the obligation by Russia not to interfere in the internal affairs of the khanate. It is interesting to note that immediately after the signing of the treaty, Ibrahim Khalil-khan by a decree of Aleksandr I on July 8, 1805, was given the rank of general and from that time forward as a lieutenant general he was forced to subordinate himself to the commander-in-chief of Russian forces in the Caucasus. This treaty, being a diplomatic document, testifies that the Karabakh Khanate became a protectorate of Russia precisely as a Muslim state. 
The seizure of the strategically vital Karabakh Khanate, in fact, meant the beginning of the complete subordination of all the khanates of northern Azerbaijan. The mountainous part of the khanate allowed for the exercise of real control over all the western districts of Azerbaijan. Subsequent actions did not represent a major problem for Russia. At the same time, while considering each in his own way the historical fates of the people, the khans could not create a single union. Justly assessing the importance of the joining of Karabakh to Russia, Prince P.D. Tsitsianov after the conclusion of the Kurakchay Treaty on May 22, 1805, reported to the Russian emperor that Karabakh by its geographic location is the gate to Azerbaijan and that Karabakh brings Georgia closer to Baku, the seizure of which was planned for the fall. 
The Azerbaijani khans followed with interest the course of the first Russian-Iranian war (1804-1813). While they desired the victory of the southern neighbor, they were also afraid of it and did not cease to hope that by the results of the war they would be able to increase their own independence. In its turn, the Russian Army did not especially trust the local Muslims. In 1806, when Iran attempted an attack on Shusha, Major Lisanevich, the chief of the fortress garrison, wary of the unexpected actions by the Karabakh khan, slaughtered the entire family of Ibrahim Khalil-khan with the exception of one son, Mehdi Guli-aga. This event only confirmed the symbolic nature of the appointment of the Karabakh khan to the rank of lieutenant general of Russian forces. At the same time, having dealt summarily with Ibrahim Khalil-khan, Russia did not change the status of his khanate. Mehdi Guli-aga by order of the Emperor Aleksandr I of September 10, 1806, was named ruler of Karabakh in place of his father. 
As a sign of Mehdi Guli-aga’s status as the administrator of the khanate, Emperor Aleksandr I presented him with a banner and sword set with precious stones. And just as in the Kurakchay Treaty, so too in the emperor’s appointment of Mehdi Guli-aga as ruler of Karabakh, there is reference to the Javanshir family as the rulers of Karabakh, both mountainous and lowland, and to the fact that all strata of the population of these reasons are subordinate to Mehdi Guli-aga. The new khan was filled with hatred to the Iranians and distrust to the Russians who had slaughtered his family, but in the end, the anti-Iranian attitudes came out on top.
The victory over Napoleon led to a toughening of the Eastern Policy of Russia. General A.P. Yermolov, who was appointed governor of the Caucasus in 1816 from the very first days did not trust the Muslim people, seeing them as a potential enemy. For this reason, he sought the opportunity for the formal liquidation of the khanates, which he thought at any moment could become the nucleus of a movement for independence. The representative of Yermolov in Northern Azerbaijan, an Armenian General V.G. Madatov, actively helped him in this. Slowly, but faithfully, they realized their plan. In 1819, they liquidated the Shaki khanate. Not being able to resist Russian pressure, Mehdi Guli-aga fled to Iran, and the Karabakh khanate was converted into a Russian province. A. Griboyedov wrote that together with the khan, three thousand Muslim families moved to Iran. And, thus, in spite of what had been written in the various treaties, the process of the liquidation of the khanates reached its logical conclusion.
In 1826, the second Russian-Iranian war began. And again, the main events developed in Karabakh. For 48 days, the Iranian forces laid siege to Shusha, but they were not able to take the city. On February 10, 1828, in the settlement of Turkmanchay near Tabriz, the two sides concluded a new peace treaty, according to which all the khanates of Northern Azerbaijan, including Karabakh, Nakchivan and Irevan khanates finally became part of the Russian Empire.
There were many interesting moments in the process of uniting the South Caucasus to Russia. In recent times, a number of Armenian and Russian historians, as well as certain political circles, have been asserting the Karabakh was joined to Russia as an Armenian district. Certain contemporary Russian and Armenian scholars insist that in the course of the entire 18th century, the Armenians of Karabakh made up 97 percent of the total population of this region. A question arises in this case: if this was really so, why then wasn’t it an Armenian state that arose in Karabakh in the middle of the 18th, but it rather was the Karabakh khanate, which was headed by representatives of the famous Turkic tribe of the Javanshirs? Indeed, there is no single case in history where three percent of the population could create a state on the backs of the other 97 percent.
However, a careful study of the international legal documents of this period raises some interesting questions concerning the form of the inclusion into Russia not only of Karabakh, but also of Armenia itself. Thus, Georgia, according to the Georgian treaty of 1801 and the Azerbaijan khanates by the Gulistan (1813) and Turkmanchay (1828) treaties were included in Russia. A reasonable question arises: According to what treaty, agreement or declaration did Armenia and the territories to which it makes claims pass into Russia? Well-known Armenian historians have found a very easy answer to this question. Not observing scholarly ethics and historical evidence and not being restrained by long established historical truth, they write that “According to the Gulistan Treaty of 1813 which ended the Russian-Persian War of 1804-1813, along with other northeastern provinces of Eastern Armenia (Lori-Pambak, Shamshadin, Zangazur, Kafan and Shoragel districts), the Ganja and Karabakh khanates were transferred to Russia as well … According to the terms of the Turkmanchay Treaty (February 1828), which ended the second Russian-Persian War (1826-1828), the Yerevan and Nakhchivan khanates and Ordubad district passed to Russia. This completed the final unification of all eastern Armenian lands to Russia.” 
In an effort to support their falsification of history, they cite the collection of documents published by G. Yusefovich in Petersburg in 1869.  They do so even though they know perfectly well that neither in the Gulistan nor in the Turkmanchay treaties published in Yusefovich’s collection, there is no reference to any Armenian lands—neither eastern nor Western; nor is there even a single reference to Christian lands. There is only reference to Muslim khanates and their unification with Russia. The absolute majority of the population of the Irevan khanate consisted of Muslims and this was reflected in Russian sources. In 1828, for example, when the “Armenian oblast” was created within the borders of the Irevan and Nakhchivan khanates, three-quarters of its population consisted of Muslims. This is confirmed by a letter of General Paskevich to the chief of the General Staff, in which he expresses his dissatisfaction with the actions of General Krasovsky, who was named chief of the “provisional administration” of Irevan and of Archbishop Nerses, a member of this administration. Paskevich criticizes Krasovsky for allowing Nerses to exercise unlimited influence over all affairs and in the harmful protection of Armenians, when “three quarters of the population of the oblast consist of Muslims.” 
The khanates’ loss of their special status meant the transformation of Karabakh into a colony, and this process lasted for decades. Over the course of this period, the administrative division of the Trans-Caucasus was frequently changed and only had finally formed by the second half of the 19th century. Following the liquidation of the khanates, the comendant system of administration was introduced in Northern Azerbaijan. All of Karabakh with a center in Shusha was included in the Military-Muslim District. However, such distribution certainly did not correspond with the ethnographic, historical, and religious peculiarities of the local population. In Karabakh, this took place in a particularly sharp way.
Demography was gradually converted into an instrument of policy. At the dawn of Armenian resettlement into these areas, a document of July 19, 1811—one that was prepared for the Ministry of Internal Affairs of Russia—noted that there lived 12,000 families in Karabakh oblast, of which 2,500 were Armenian and the remainder were followers of the religion of Muhammad.  In 1823, the Russian administration prepared “A Description of the Karabakh Province,” which contained statistical data about the population of this district and its ethno-religious composition. Judging by the statistical data prepared by Russian institutions and included in this valuable source, there were 600 settlements in the Karabakh oblast at that time, of which 450 were Muslim and only 150 registered as Armenian.  According to this reliable source, 20,095 families lived in Karabakh oblast in 1823, of whom 15,729 were Muslims and only 4,366 (21.7 percent) were Armenians.
According to the 1832 census, the number of families in Karabakh reached 20,456, but the number of Armenian families over these very same ten years rose to 31.6 percent.  In Shusha, which was considered the center of Karabakh, of the 1,532 families in 1823, 1,111 were Muslim (72.5 percent), 421 were Armenian (27.5 percent), but already by 1832 because of Armenian re-settlers, this figure reached 44.9 percent. The Russian military historian V. Potto notes that the first major resettlement of Armenians to Karabakh took place in 1828. He writes that on March 16, 1828, 40,000 Armenian families left Persia for Irevan oblast. However, because of a shortage of bread, 5,000 families—the first group of re-settlers—were forced for a long time to wait on the shores of the Araz, but were eventually sent to Karabakh. 
The Russian writer S.N. Glinka provides some interesting data on the movement of Armenians from Iran to Karabakh. The political character of the resettlement of Iranian Armenians in Muslim lands just seized by Russia is clearly evident in the appeal to the Persian Armenians by an active participant of this resettlement, G. Lazarev: “Christians! According to reliable rumors which have reached me, badly intentioned people are trying to disseminate not only foolish and false news, but even to sow fear in those seeking resettlement about Russia’s good intentions and thus to change the desire of their hearts.”  He writes further that “Armenians from various settlements, emboldened by Turkmanchay, moved toward Karabakh,”  and in the course of three and a half months, “more than 8,000 families crossed the Araz.”  In the spring of 1828, when the flood of Armenians moved toward the Araz, a directive from Paskevich was issued to resettle the poorest in Karabakh, and this also found reflection in the Russian literature of that time.  As a result, in 1832, Armenians formed 31.6 percent of the population of Karabakh, with Muslims still retaining their majority of 68.4 percent. 
After 1828, the resettlement of Armenians into the Muslim provinces of the South Caucasus was regulated by Paragraph XV of the Turkmanchay Treaty.  By a decree of Emperor Nikolay I on March 21, 1828, “an Armenian oblast” was established on the lands of the former Irevan and Nakhchivan khanates.  The Russian general and Georgian Prince A. Chavchavadze was named the head of “the Armenian oblast.” 
In the second volume of the historical novel of Catherine’s time, “The Favorite” by V. Pikul, the well-known author of historical novels, there is an interesting conversation between Count G. Potemkin and Catherine II, in which the former advises that the appearance of new Armenian communities in the Transcaucasus will create problems if not now then in the future. When he was creating his historical works, Pikul scrupulously worked in the archives and strictly guided himself on the basis of historical documents. At the moment of the formation of this oblast, 75 percent of its population consisted of Muslims. If during the period of the Russian conquest, 49,875 Muslims lived with 20,073 Armenians, then immediately after the formation of “the Armenian oblast” 45,200 Armenians were resettled from neighboring countries.  The situation in Nakhchivan oblast evolved in a similar way. At the moment of the completion of the Russian occupation, 17,138 Muslims and only 2,690 Armenians lived there. With the liquidation of the khanate, 10,670 Armenians in a short interval of time resettled there. In an analogous way, in the Ordubad part of Nakhchivan, where initially 7,247 Muslims and 2,388 Armenians lived, 1,340 Armenians were resettled in order to change the balance between them. 
The Russian researcher N.I. Shavrov in 1911 published a book in which, basing himself on documents, he noted that 40,000 Armenians from Iran and 84,600 from Turkey resettled in the Caucasus in 1828-1830, and they were settled in Yelizavetpol and Irevan guberniyas, where before this, the number of Armenians was almost equal to zero. N. Shavrov wrote that “of the 1.3 million Armenians who are living in the Transcaucasus, more than a million are re-settlers. We resettled them here.” 
Apparently, the desire to completely Christianize the Transcaucasus was strong. But the specific features of the situation led the Russians to act carefully, and A. S. Griboyedov, the Russian ambassador to Persia, warned that the Armenians would remain permanently in the lands to which they were resettled, something that could trigger problems with the indigenous Muslim population.  Such concerns, which were shared by the Azerbaijanis, were justified. The Armenians settled down on Azerbaijani lands and a little later began to display hostility toward the masters of these lands. I. Chavchavadze justly noted in his appeal to Armenians seeking to settle in Georgia that they must not view those accepting them as enemies. 
In the course of the entire 20th century and especially in the last two decades, Azerbaijan and the Azerbaijani people have experienced and are experiencing pain and suffering for their “hospitality” in relation to Armenians, one which A. Griboyedov and I. Chavchavadze so precisely predicted.
 “The Treaty between the Karabakh Khan and the Russian Empire concerning the transfer of the khanate under the power of Russia of May 14, 1805,” State Historical Archive of the Azerbaijan Republic, f. 130, d. 14, ll. 245-248.
 “Akty Kavkazskoy Arkheograficheskoy Komissii,” Arkhiv Glavnogo Upravleniya Namestnika Kavkaza, in Russian, ed. by A.D. Berzhe, Tiflis, 1868, vol. 2, p. 698.
 “Akty Kavkazskoy Arkheograficheskoy Komissii,” Arkhiv Glavnogo Upravleniya Namestnika Kavkaza, in Russian, ed. by A.D. Berzhe, Tiflis, 1868, vol. 2, pp. 336-337.
 Nagorny Karabakh: Istoricheskaya Spravka, in Russian, Yerevan, 1988, pp. 14-15.
 Dogovory Rossii s Vostokom, Politicheskiye i Torgovyye, in Russian, assembled and published by T. Yusefovich, St. Petersburg, 1869, pp. 208-214.
 See Potto, V.A. (1993) Kavkazskaya Voyna. Persidskaya Voyna 1826-1828 gg, in Russian, Stavropol, vol. 3, pp. 594-595.
 The Unificaiton of Eastern Armenia to Russia, Yerevan, 1972, pp. 560-561.
 “Opisaniye Karabakhskoy provintsii, sostavlennoye v 1823 gody, po rasporyazheniyu glavnoupravlayushchego v Gruzii Yermolova, deystvitelnym statskim sovetnikom Mogilevskim i polkovknikom Yermolovym,” in Russian, two volumes, Tiflis, 1866.
 Grazhdanskoye Upravleniye Zakavkaz’yem ot Prisoedineniya Gruzii do Namestnichestva Velikogo Knyazya Mikhaila Nikolayevicha, in Russian, Istoricheskiy Ocherk, p. 146.
 See Potto, V.A. (1993) Kavkazskaya Voyna. Persidskaya Voyna 1826-1828 gg, in Russian, Stavropol, vol. 3, p. 591.
 Glinka, S. N. (1831) Opisaniye Pereseleniya Armyan Adderbidzhanskikh v Predely Rossii, in Russian, Moscow, pp. 107-111.
 Ibid, p. 48.
 Ibid, p. 92.
 Ibid, pp. 90-91.
 Obozreniye Rossiyskikh Vladeniy za Kavkazom v Statisticheskom, Etnograficheskom, Topograficheskom i Finansovom Otnosheniyakh, in Russian, Tiflis, 1836, p. 267.
 Polnoye Sobraniye Zakonov Rossiyskoy Imperii, in Russian, St. Petersburg, 1830, vol. 3, p. 130.
 Polnoye Sobraniye Zakonov Rossiyskoy Imperii, in Russian, St. Petersburg, 1830, vol. 3, pp. 272-273.
 “Akty Kavkazskoy Arkheograficheskoy Komissii,” Arkhiv Glavnogo Upravleniya Namesnika Kavkaza, in Russian, under the editorship of A.D. Berzhe, Tiflis, vol. VII, p. 487.
 Obozreniye Rossiyskikh Vladeniy za Kavkazom v Statisticheskom, Etnograficheskom, Topograficheskom i Finansovom Otnosheniyax, in Russian, Tiflis, 1836, p. 229.
 Ibid, p. 229.
 Shavrov, N. I. (1911) Novaya Ugroza Russkomu Delu v Zakavkaz’ye: Predstoyashchaya Rasprodazha Mugani Inorodtsam, in Russian, St. Petersburg, pp. 59-60.
 Griboyedov, A. S. (1971) Sochineniya v Dvukh Tomakh, in Russian, Moscow, vol. 2, pp. 340-341.
 Chavchavadze, I. (1902) Armyanskiye Ucheniya I Vopiyushchiye Kamni, Tiflis, p. 123.