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.