1813 treaty ending the war between Imperial Russia and Persia
The Treaty of Gulistan (also spelled Golestan: ; ) was a peace treaty concluded between the Russian Empire and Qajar Iran on 24 October 1813 in the village of Gulistan (now in the Goranboy District of Azerbaijan) as a result of the first full-scale Russo-Persian War (1804 to 1813). The peace negotiations were precipitated by the successful storming of Lankaran by General Pyotr Kotlyarevsky on 1 January 1813. It was the first of a series of treaties (the last being the Akhal Treaty) signed between Qajar Iran and Imperial Russia that forced Persia to cede the territories that formerly were part of Iran.
The treaty confirmed the ceding and inclusion of what is now Dagestan, eastern Georgia, most of the Republic of Azerbaijan, and parts of northern Armenia from Iran into the Russian Empire.
The text was prepared by the British diplomat Sir Gore Ouseley, who served as a mediator and wielded a significant degree of influence in the Persian court. It was signed by Nikolai Rtischev for Russia and Mirza Abolhassan Khan Ilchi for Persia.
The result of the treaty was the transfer of the bulk of Iran's Caucasian territories to the Russian Empire. The treaty also directly contributed to the outbreak of the next war of the 19th century: the Russo-Persian War (1826–1828), in which the Iranian forces were defeated once more. In the following Treaty of Turkmenchay, Qajar Iran lost possession of its last remaining Caucasian territories, comprising modern-day Armenia and the remaining part of modern-day Azerbaijan. By 1828, Iran had lost by both treaties all of those integral territories in Transcaucasia and the North Caucasus. The area north of the Aras River, including the territory of the contemporary nations of Georgia, Azerbaijan, Armenia and the North Caucasian Republic of Dagestan, were part of Iran until they were occupied by Russia during the 19th century.
As a further direct result and consequence of the Treaty of Gulistan in combination with the 1828 Treaty of Turkmenchay, the formerly Iranian territories came under the Russian, and later the Soviet control for approximately 180 years, and Dagestan remains a constituent republic within the Russian Federation to this day. Comprising most of the territory ceded in Gulistan and Turkmenchay treaties, three separate nations would gain independence following the dissolution of the Soviet Union in 1991: Georgia, Azerbaijan, and Armenia.
Background.
In 1801, the Russian Empire had sworn in a new tsar, Alexander I, who was eager to expand Russia's control over its neighboring territories. A few years previously in Iran, Fath Ali Shah Qajar also became the new shah after the assassination of his uncle, Agha Mohammad Khan Qajar, in 1797. During his reign, Agha Mohammad Khan had defeated and re-subordinated the Afsharid/Safavid vassals and subjects in the regions of modern-day eastern Georgia, Armenia, southern Dagestan, and Azerbaijan, and claimed those areas as rightfully belonging to Persia. During and after the Battle of Krtsanisi in 1795, he had regained full control over eastern Georgia, Dagestan, Armenia, and Azerbaijan. Several years later, after Agha Mohammad Khan was assassinated in Shusha and Heraclius II of Georgia had died as well. Russia, wishing to expand its territory and trade, capitalized on the opportunity to annex eastern Georgia. The Persian court attempted to align itself with France in 1801 in order to establish a better position in case of war with Russia, but those attempts were unsuccessful. Later, as both Russia and Britain were engaged in the Napoleonic Wars, Fath Ali Shah instead brokered a deal with Britain to provide Persia with military support from British troops in exchange for preventing any European country from entering India. Following the agreement, Persia entered into the First Russo-Persian War against a militarily-preoccupied Russia, which was heavily invested in the Napoleonic Wars. 
The primary motive of the Persian court when entering the war was to reassert its control over Georgia and to ensure the protection of the rest of its northwestern borders. However, Fath Ali Shah had also heard about the atrocities being committed by Russian Commanders in Georgia "through massive extortion and maladministration".
Numerically, the Persian forces had a considerable advantage during the war, wielding an army as much as five times larger than the Russians in the Caucasus. However, the Persian forces lagged behind technologically and were poorly trained, a problem that the Persian government did not recognize until far later. Despite these significant disadvantages, the fighting continued in northern Persia, Azerbaijan and in regions of Georgia. Persian court went so far as to declare a jihad against the Russian Empire and called upon its Iranian subjects to maintain unity. The Persian court also requested military and financial aid from France's Napoleon in light of the Franco-Persian alliance. Although France promised to support Iran's ambitions and help it regain its recently-lost territory of Georgia, ultimately Napoleon left Persia unassisted given France's relations with Russia were more important after the two countries signed the Treaty of Tilsit in 1807. The turning point of the war came on 31 October 1812 during the Battle of Aslanduz, in which the Persian army suffered a decisive defeat. Following the battle, Fath Ali Shah had no option but to sign the Treaty of Gulistan.
According to Cambridge History of Iran: 
Assessment.
Even today, Iran officially sees it and the later Treaty of Turkmenchay as some of its most humiliating treaties ever signed. The treaty is also regarded by Iranians as the main reason why Fath Ali Shah is seen as one of Iran's most incompetent rulers in memory. Scholars in Azerbaijan point out that the Karabakh Khanate, where the treaty was signed, had pursued an independent foreign policy as early as 1795, when "Ibrahim Khalil Khan, the wali of Qarabagh, fearing for his independence, warned Sultan Selim III of Agha Muhammad Khan Qajar's ambitions to subdue Azerbaijan and later Qarabagh, Erivan and Georgia. In the same year Muhammad Khan, the hakim of Erivan, also wrote a letter to Selim III, alerting him to Agha Muhammad's 'aggression, and seeking Ottoman protection".
Imperial Russian historians maintained that Russia's absorption of the Transcaucasia shielded the local populations from the constant Iranian and Ottoman invasions, and that the Christian nations of the Caucasus were liberated from Muslim repression, which ensured peace and stability in the region.
Vital to the signing of the treaty was the agreement made by Fath Ali Shah with Britain. With the defeat in the Russo-Persian War, the Shah understood that another attack by the Russians was almost inevitable. Britain saw such a war as unwinnable for the Persians, and so took advantage of Persia's weakness to strengthen their foreign affairs in the region. Using their new-found diplomatic connections with the British, Persia established the Treaty of Defensive Alliance in 1812, which promised that Britain would "offer a defensive alliance against further Russian encroachments". Its terms essentially stated that Persia would defend against any European army entering India, which stationed British troops, and in return, Britain would provide military and financial against any future Russian attack.
Aftermath.
The treaty of Gulistan did not answer vital questions such as whether the Persian army would be disarmed or be able to regroup. It was obvious to both sides that Persia would potentially attempt to reclaim the territories in the future, given the Persian court considered the captured regions rightfully Iranian and opposed Russia's repressive treatment of the Caucasian populations. The war had become costly in terms of finance and manpower, so the Treaty of Gulistan led to over a decade of relative peace (1813–1826) between Russia and Persia, primarily for the clause regarding trade: both governments saw substantial potential in it. Permanent diplomatic missions were set up in Persia as well as in Russia in order to keep trade open for as long as possible. The tensions remained, however, as the governments of both countries understood that the terms of the treaty were vague, and that nothing was written about provisions for the military, mainly to prevent Persia from trying to regain the regions of Georgia or the Caucasus, thus leaving open the possibility of another future war. It is likely that neither the Iranian Shah nor the Russian Tsar regarded the treaty of Gulistan as definitive.
According to Prof. Timothy C. Dowling:
According to Prof. William Bayne Fisher ("et al."):
Another consequence of Persia's losses to Russia and the subsequent treaties of Gulistan and Turkemenchay was the separation of the Azerbaijani and Talysh people from their brethren in Iran.
The area to the North of the river Aras, amongst which is the territory of the contemporary nations of Georgia, Azerbaijan, Armenia and the North Caucasian Republic of Dagestan, were Iranian territory until they were occupied by Russia in the course of the 19th century.
Precursor to Second Russo-Persian War of 1826–1828.
The Treaty of Gulistan did not resolve the possibility of a future conflict between Russia and Iran. Russia's priority before the war was Europe and the Napoleonic Wars, which explains the relatively small number of troops that Russia dedicated to the Russo-Persian War. The Treaty of Gulistan can be primarily regarded as a way for both countries to "gain a breath" so that they could focus on other issues. After the treaty was signed, Persia began rapidly building up its army once more, as Fath Ali Shah was fully devoted to regaining the lost territories. It is therefore not surprising that Fath Ali Shah ordered his military commander, Abbas Mirza, to start training troops in 1823, three years before the following Russo-Persian War. Furthermore, the Persian clergy publicly announced that the jihad against Russia was not over. In 1826, Persia, with British support, once again invaded the territories lost to Russia. The second war lasted two years, and Persia lost 35,000 troops to Russia's 8,000. Persia's defeat culminated in the Treaty of Turkmenchay, which resulted in further losses of modern-day Armenia and the remaining parts of Azerbaijan.
References.
 ;templatestyles src="Reflist/styles.css" / ;