the Russian Empire on the transfer of the Karabakh Khanate to Russia during the war, but was not fully realized, as both parties were still at war and the Russians were unable to consolidate any effective control over Karabakh. The Russian Empire consolidated its power in the Karabakh Khanate following the Treaty of Gulistan in 1813, when Iran was forced to recognize the Karabakh Khanate, along most of the other khanates they possessed in the Caucasus, as belonging to Russia, comprising present-day Dagestan and most of the modern-day Republic of Azerbaijan, while officially ceding Georgia as well, thus irrevocably losing the greater part of its Caucasian territories. Absolute consolidation of Russian power over Karabakh and the recently conquered parts of the Caucasus from Iran were confirmed with the outcome of the Russo-Persian War of 1826–1828 and the ensuing Treaty of Turkmenchay of 1828. During the Russo-Persian War of 1826–1828, the citadel at Shusha held out for several months and never fell. After this Shusha ceased to be a capital of a khanate, which was dissolved in 1822, and instead became an administrative capital first of the Karabakh province (1822–1840), and then of the Shusha Uyezd of the Elisabethpol Governorate (1840–1923). Shusha grew and developed, with successive waves of migrants moving to the city, particularly Armenians, who formed a demographic majority in the surrounding highlands. Beginning from the 1830s the town was divided into two parts: Turkic-speaking Muslims lived in the eastern lower quarters, while Armenian Christians settled in the relatively new western upper quarters of the town. The Muslim part of the town was divided into seventeen quarters. Each quarter had its own mosque, Turkish bath, water-spring and also a quarter representative, who would be elected from among the elders (aksakals) and would function similarly to the head of a modern-day municipality. The Armenian part of the town consisted of 12 quarters, five churches, a town and district school and a girls' seminary. The population of the town primarily dealt with trade, horse-breeding, carpet-weaving and wine and vodka production. Shusha was also the biggest centre of silk production in the Caucasus. Most of the Muslim population of the town and of Karabakh, in general, was engaged in sheep and horse-breeding and therefore, had a semi-nomadic lifestyle, spending wintertime in lowland Karabakh in wintering pastures and spring and summer in summering pastures in Shusha and other mountainous parts. In the 19th