The town was granted several royal rights, including the privilege to organise several markets a year. At that time, Rzeszów finally grew beyond its medieval borders, marked by fortifications. In 1638 Rzeszów passed into the hands of the powerful and wealthy Lubomirski family, becoming the center of its vast properties. At first, the town prospered and in 1658, the first college was opened there, which now operates as High School Nr 1. The period of prosperity ended, and furthermore, there were several fires and wars, which destroyed the town. Rzeszów was first captured by the Swedes during The Deluge, then by the troops of George II Rákóczi leading to the Treaty of Radnot. During the Great Northern War, the Swedes again captured Rzeszów, in 1702, then several different armies occupied the town, ransacking it and destroying houses. In the mid-eighteenth century, the town's population was composed of Poles (Roman Catholics) and Yiddish Jews in almost equal numbers (50.1% and 49.8%, respectively). In 1772, following first partition of Poland, Rzeszów became part of the Austrian Empire, to which it belonged for 146 years. In the late 18th century, Rzeszów had 3,000 inhabitants. By the mid-19th century, the population grew to around 7,500, with 40% of them Jewish. In 1858, Galician Railway of Archduke Charles Louis reached Rzeszów, which resulted in further development of the town. In 1888 first telephone lines were opened, in 1900 – gas street lamps, and in 1911 – power plant and water system. The population grew to 23,000, with half of the inhabitants being Jews. A number of modern building were constructed, most of them in Secession style. During World War I, several battles took place in the area of the town. Rzeszów was home to a large garrison of the Austro-Hungarian Army, and in the city of Przemyśl, located nearby, there was a major fortress. During the Battle of Galicia in the late summer of 1914, Russian troops moved towards Rzeszów, and on 21 September, they captured it. First Russian occupation lasted only 16 days, ending after an attack of the Austrians, on 4 October. Under Russian pressure, the Austrians were unable to keep the town, and on 7 November, the Russians again appeared in Rzeszów.