beginning of the 17th century, Kursk was repeatedly attacked by the Polish–Lithuanian Commonwealth forces (in 1612, 1616, 1617, and 1634), the Crimean Khanate, and the Nogai horde, but the Kursk fortress was never taken. Residents of Oryol and other southern Russian cities were resettled in Kursk (by 1678 2,800 had been resettled). The city developed due to its advantageous geographical position on the shortest route from Moscow to the Crimea and from Moscow to Kiev. It was an important center of the corn trade with Ukraine and hosted an important fair, which took place annually under the walls of the monastery of Our Lady of Kursk. It was successively part of the Kiev Governorate (1708–1727), Belgorod Governorate (1727–1779), and Kursk Viceroyalty (1779–1797). The town status was granted to Kursk in 1779, and it became the administrative center of Kursk Governorate in 1797. After a fire in 1781 devastated Kursk, a new plan for the city was developed in which a market center would be placed in the central square, known as the Red Square. In 1768, the Voskresensko-Ilinskaya Church was built (). In 1778 both the baroque Sergiev Cathedral and Trinity-Sergius Cathedral were completed. The city opened its first school for nobility in 1783. A men's gymnasium was opened in 1808 and a seminary in 1817. A women's gymnasium was opened in 1872. At the beginning of the 20th century Kursk played a dominant role in the food industry (Kvilitsu AK, one of the largest breweries in Russia, operated in Kursk) and in other industries; in the 1900s, the city had 4 sitoproboynye shops (of which the largest was the Tikhonov works, whose products were exported to Germany, Austria-Hungary, etc.). There were several engineering enterprises operating in Kursk (in 1914 there were seven, including a railroad one). The working conditions in the factories of Kursk were harsh, and workers' strikes were frequent (for instance, the workers at the sugar mill went on strike in 1901–1903). The Kursk workers also participated in the general political strike during the 1905 Russian Revolution. On November 26 (December 9 - new style), 1917 the Soviets took power in Kursk. On September 20, 1919, the city was taken over by the troops under the command of General Denikin; however, on November 19, 1919, Kursk was retaken by the Red Army. The Soviet government valued Kursk for its rich deposits of iron ore and developed it