At the beginning of the 18th century, the Safavids state was ruled by Shah Sultan Hussein (1694-1722), and the state was in economic and political crisis. The state Treasury was devastated so that the coins were prepared from valuable metals, which were preserved in the mausoleums of Ardebil.
Due to fill state Treasury, satisfy requiriments of beurocrachy and feudal nobility state officers increased the taxes. The poored Shah Treasury did his best to gather much more taxes from ordinary citizens and they did not take into account their material circumstances. Cruel feudal exploitation of wide mass caused to the intensifation of anti- feudal fight. Because of increasing state expences, Shah administration obliged to take taxes even from high stratum and this was not casual that economic aims and political interests of people mass and some levels of feudal nobility of Azerbaijan in that period were the same, they shaped general front of struggle, which was firstly against Iranian regime that had formed since the first decades of the 17th century, in Azerbaijan. There began hunger and drought in Shirvan and other regions of Azerbaijan in 1700-1703s. In 1707, Car-Balaken Camaats rebelled against Shah’s regime and there happened peasants’ revolts against the increasement of taxes in Tabriz and Mughan. In 1707, craftsmen and urban poor of Tabriz in South Azerbaijan raised against the existing regime. The revolt of Tabriz citizens, which extended to peasant mass revised in 1711. Peasants’ revolts happened in Soyugbulaq and Mughan during 1709-1715s.
Aggravated circumstances of peasants caused to new uprisings in Shirvan (1709) and Car (1711). Shah demanded cruel measures from his local beylerbeys against rebels in these regions. Necessity of struggle against rebels and foreign invaders scared the administration of Safavids state.
The struggle against Iranian yoke intensified in Azerbaijan and Southern Daghestan during 1720-1721s. Haji Davud – one of the representatives of clergy appealed to Russia for support in the fight for the throne in Shirvan and Daghestan. This appeal replied to the interests of Russia, which organized expeditions, sent its representatives to Azerbaijan under the frame of embassies and merchant caravans since the beginning of the 17th century and aimed to invade pre-Caspian territories of Azerbaijan and Iran. Even in 1713, Shah Sultan Hussein sent his representative Fazlullah bey to Petersburg in order to conduct an “agreement about friendship and trade” with Russia. An appeal of Safavids administration concurred with the dream of Petr I, who wanted to activate his Eastern politics. Unsuccessful war with Turkey and Prut treaty of 1711, obliged Russia to refuse from her plans about Black Sea and to tie her expansive hopes with the Caspian basin. Due to learn the Eastern shore of Caspian Sea Petr I sent an expedition under the leadership of Bekovich-Cherkasskoy (in 1714) and then there was sent the closest officer of the tsar-Artimey Volinsky to Shah’s palace in 1715. Petr I gave several instructions to Volinsky, such as to learn socio- economic circumstances, caravan ways and general mood of population there. After long and continuous preparations the expedition launched from Astrakhan on July 13, 1716, arrived in Derbent-Niyazabad, then Shamakha in the content of 71 men in August of 1716. Russian merchants of Shirvan applied to Volinsky with complaint. Passing through Tabriz the embassy of Volinsky stayed in Isfahan on March 1 of 1717. Here Volinsky was received by Shah and on June 30, 1717, Volinsky (by the order of Petr I) and Fatali-khan officially signed the first Russian-Iranian trade agreement. Simultaneously, Volinsky and other members of their embassy gathered wide information about the circumstances in Safavids state and Volinsky directed reports to the tsar. He wrote in one of them that “I see the weakness here, we can begin the war without any danger… we will be able to annex the great part to Russia easily”.
In December of 1717, Volinsky returned to Shamakha, where he met with the representatives of Christian land-owners of South Caucasus and Armenian merchants of Derbend secretly. Armenian merchants gave the plan of Derbend fortress to Volinsky. On June 25 of 1718, Volinsky left Azerbaijan, arrived in Petersburg and personally met with Petr I, who rewarded and appointed him the governor of Astrakhan. After the victory of 20 years war with Sweden and the sign of Nishtadt peace treaty, Petr I began to the realization of Pre-Caspian campaign.
During the process of uprisings of people mass, some representatives of high stratum, which suffered from Iranian government, did their best to direct it against foreign supremacy. One of such representatives of high stratum was the head of clergy in North- Eastern Azerbaijan, citizen of Dedeli village of Mushkur mahal of Quba, Haji Davud. When he was in Daghestan, he allied with the governor of Kazikumukh-Surkhay khan about the distruction of khans and state officers – Shah’s representatives – in Sheki, Shirvan and Quba.
Soon, several small-feudals of Southern Daghestan joint to the detachment of Haji Davud. The joint detachments attacked to Iranian garrison and strengthened points. But these attempts did not give any result. Haji Davud, who became sure that he could not be successful only with the aid of peasants, appealed to Russian government. But Haji Davud’s aim about becoming independent governor in Shirvan did not concur with the plans of Petr I, who personally wanted to make campaign to Azerbaijan. That is why, Haji Davud’s appeal wasn’t accepted. So, Haji Davud appealed to much more influencive for Daghestanian feudals for military aid. In August of 1721, Haji Davud besieged Shamakha in the alliance with Daghestanians’ detachment of Kazikumukhlu Surkhay khan, hired troops and took the city. After the invasion of Shamakha, there began robbery and plundering of the city by hired troops; Foreign merhcants, which were in Shamakha at that time were also robbed. Russian merchants were plundered much more and that was met with great disagreement by Russian administration. After that rebels took Shamakha, Haji Davud completely liquidated Safavids administration here, burnt tax registers and shaped new and much lighter tax system. So, there was founded independent state entity- khanate in the center of Shirvan beylerbeylik, around the ancient capital of Northern Azerbaijan which was separated from Iranian state.
Although much more strengthened national uprisings in the Northern regions of Safavids state converted to sunnism, they were not initiated by Ottoman Empire, which was engaged with her personal local problems. Uprisings had real internal causes that were related with socio-economic development of Eastern feudalism and international circumsatances of the state.
Expansive goals of Russian state in Caucasus, especially in pre- Caspian regions at the beginning of the 18th century, confronted with the same pretends of the Ottoman Empire.
The thought about the organization of campaign to pre-Caspian regions of Petr I was related with the policy of Russian supremacy in Baltic, Black and Caspian Seas, as well as the requests of Christian feudal governors of Southern Caucasus. The aim of the planned campaign consisted of two issues: 1) Conguest of the South-West of Pre-Caspia; 2) strengthening in the whole South Caucasus.
Due to completely strengthen in the Pre-Caspian lands, it was important to take not only narrow shore line, but also deep areas of Transcaucasus; that is why, there was examined to make campaigns to Tabriz and other lands of Azerbaijan, as well as Kartli in the plans of 1722-1723 years’ expeditions. But, after the beginning of the campaign, Petr I put his second duty for the future because of the resistance of Ottoman Empire.
The Ottoman Empire was defeated by European state powers in the war of 1683-1698. But, it did not mean that the empire declined, since the Ottoman state was able to afford the results of this lost. The Ottoman Empire did her best to make revenge and to substitute her losts in other directions – specially in the Eastern areas. The Caucasus took the mainest place in the plans of the leading powers of Ottomans.
The result of the fought between two empires for pre-Caspian region depended on the military power of rival sides and several other circumstances. Russia could not precede the Ottoman Empire with her population potentiality at that time. Russia was also weak in military side, which was proved by Prut lost of 1711. But at the result of Petr I’s reforms, there was created the condition for the development of the state. At the result of the victory over Sweden, Russia came to the same line with great European powers and further centralization of state reign continued in this country.
The Ottoman Empire, which situated in the intersection of the East and the West played an important role in the struggle of West and East and this point caused to the improvement of her military power. It was showen in this simple example that the population of this state was divided into two major groups: soldiers (askeri) and civil (rayat).
At the result of unsuccessful Prut campaign of Petr I in 1711, Ottoman Empire attained to return Azov and after this event it got opportunity to act much more actively in the East. The Ottoman court disagreed with the decrease of the export of silk and raw-silk through Turkey. This decrease was related with the icreasing of the export of these materials from Iran through Volga-Caspian way and Persian Gulf.
Turkish envoy also demanded from Iran not to make trade with Christian states, which Turkey conducted war with and did his best to persuade Iranian government to make trade only through Turkey. Besides of this, according to one source Sultan couldn’t get his gift from silk in the amount of 40 vyuk per year from Shah. So, both states were ready to utilize the collapse of Safavids Iran, to capture the part of its territories and acquire suitable military-political position.
Before beginning the campaign, Petr I, who possessed great world-outlook prepared “Manifest” in Azerbaijan language, which was proclaimed the aim of the campaign. There were proclaimed only little reasons of the campaign to pre-Caspian provinces and there was stressed that Haji Davud and his ally Surkhay khan Kazikumukhly were “rebels” of his friend-the brother of Iranian Shah, who should be punished in the “Manifest”. Russian empire promised peace and calm life to the people. The “Manifest” of Petr I was the first publication in Azerbaijan language.
On July 18 of 1722, Russian navy, led by Petr I launched from Astrakhan and directed to the South. On the land there was directed the cavalry from kazakhs, kalmeks and the detachment of regular army. On August 15, the navy reached to Derbend. The unification of troops and order took one week. Petr reached here with 100 thousandth army, 32 thousand from it were cavalry and unmounted troops. The naib of Derbend – Imamgulu bey decided to hand over city-fortress and met Petr with silver keys of the city and with the manuscript of “Derbentname” of the 16th century. Russian army entered to Derbent without fought. Although Petr warned the Senata that this company would not last long, but he also mentioned that because of hot weather they encountered with great difficulties. He highly appreciated the action of Imamqulu bey, gave him the degree of general-major, title of khan and the “reign of Derbent”.
Although the goals of the campaign were great, the mainest duty of Russians was to conquer Shamakha and to settle here. As Shamakha was the major point in Russian-Ottoman confrontation, it took the first place in the campaign of 1722. This campaign was officially called “Shamakha campaign” in the diplomatic negotiations of Petersburg. In the military assembly, hold in Derbent on August 29, Petr ordered to return the big part of this great army and he came back to Moscow through marine way-Astrakhan. The bought of equipment for soldiers and horses demanded big amount of money. The attitude of Turkey and Sweden to this campaign demanded caution and careful actions, as well.
All these reasons made Petr move in pre-Caspian regions with small military parts. Petr had ordered to capture the city of Resht to the general Shipov, in stead of he was in Derbent and this city was conquered in November of 1722. The one of the mainest duties of Petr was the conquest of Baku-the biggest port of Caspian Sea. Simultaneously, the Ottoman Sultan could not reconcile with the occupation of Pre-Caspian regions by Russian troops and in 1723, he also directed his army to the frontiers of South Caucasus. Big amounted Turkish army captured Tiflis and moved to the East. The danger of the occupation of the whole Caucasus by Turkey, made Petr I hurry up his military expedition to Baku, which had not been conquered in 1723 yet. Petr I wrote letter to general-major Matyushkin and ordered him to conquer the Baku castle. The emperor wrote: “There was gotten information from Georgia that Turks have made them obey and now they are moving to Shamakha: they are able to capture Baku too”.
Matyushkin responded with the bombing of the city from ships to the rejection of Baku governor about handing over the castle. Bombing of the city, which lasted four days made the garrison of Baku to end the resistance. Baku fortress laid down of July 27 of 1723 and Matyushkin immediately warned Petr I about it.
In 1722-1723s the internal decline of Safavids state came to an end. More than half of its territory was captured by afgans, lots of governors of subordinated countries went out the Shah’s subordination and the Western regions of the Caspian Sea passed to the hands of Russia. Shah appealed either to Russia, or to Ottoman Turkey for an aid.
Shah Tahmasib II was neither able to fight with afgans, nor to organize the defence of his properties from the danger of Ottoman occupation. Petr I understood it well and that is why, he did his best not to permit Turkey to intervene the Caspain Sea and pre-Caspian regions.
Russia, which was not interested in war with Ottoman Turkey and which really appreciated its opportunities and power comparison conducted treaty of Istanbul with Turkey on July 12, 1724. According to Istanbul Treaty, South Caucasus was divided between Ottoman Empire and Tsar Russia. Sultan accepted the right of Russian state over pre- Caspian provinces-in width of 119 verst from Derbent and 43 verst from Caspian Sea to Shamakha; and Russia promised not to prevent the occupation of other parts of South Caucasus and Western provinces of Safavids state, including Southern Azerbaijan by Ottomans. There were created three boundaries between the lands passed to Turkey and Russia. The one of them was situated in the 1/3 distance between Shamakha and the Caspian Sea; the second of them was in the “depth” from Derbent and the third border was situated in the location, called Sugovushan in the confluence of Kur and Araz.