was mostly inhabited by Lithuanians and Ruthenians, however the German merchants, artisans, Jews (since the 14th century; later had their qahal until 1845) and the Tartars (since 1397) also settled down in Vilnius. In the 16th–17th centuries, during Reformation and Counter-Reformation, the Polonophone population began to grow – by the middle of the 17th century most writings were in Polish due to the Polonisation (before the 16th century the number was only around 5%). The city prospered during the Golden Age by being one of the main cities of the Polish–Lithuanian Commonwealth and the residence of the Lithuanian nobility. However, the city was severely devastated by fire in 1610. After the Battle of Vilnius in 1655 the city came under Russian control (1655–1661). Next, after the Great Northern War, the Swedish Empire controlled the city from 1702 to 1709. This occupation ended during the Great Northern War plague outbreak in 1709. It took the city more than 50 years to recover. According to the first population census of the Commonwealth in 1790, the Vilnius Voivodeship (without the Grodno County) had a population of 718,571 residents, while the Vilnius County had 105,896 residents (the whole Grand Duchy after the Second Partition had a population of 1,333,493 then). Shortly after, the city population decreased to just 17,500 residents in 1796 due to the fierce battles of the Vilnius uprising in 1794, which was the last attempt to save the Grand Duchy's capital from falling under the complete Russian control. Though, after the rebels defeat, Vilnius was incorporated into the Russian Empire and was its third largest city in the beginning of the 19th century. After a few decades of the Russian despotism, Vilnius demographics were once again affected by the November Uprising in 1830 and the January Uprising in 1863, during which rebels attempts were made to restore the statehood. According to the Russian Empire Census of 1897, Vilnius had 154,532 residents and later grown to 205,300 residents in 1909, while the Vilna Governorate had 1,561,713 residents in 1897. During World War I thousands of Vilnians were forced to flee, were killed or were taken to the forced labor camps; consequently the city had only 128,500 residents in 1919 (in total, the present-day Lithuania territory lost around 1 million residents). Vilnius recovered during the interwar period and had 209,442 residents in 1939, but due to World War II the number fell to