Ganja is Azerbaijan's third largest city, with a population of around 335,600. The city has been a historic and cultural center throughout most of its existence. It was the capital of the Ganja Khanate until 1804; after Qajar Iran ceded it to the Russian Empire following the Treaty of Gulistan in 1813, it became part of the administrative divisions of the Georgia Governorate, Georgia-Imeretia Governorate, Tiflis Governorate, and Elizavetpol Governorate. Following the dissolution of the Russian Empire and the Transcaucasian Democratic Federative Republic, it became a part of the Azerbaijan Democratic Republic, followed by Azerbaijan SSR, and, since 1991, the Republic of Azerbaijan.