The town remained under the authority of the Archbishops of Gniezno, and as a residency of the Primates of Poland, since 1572 Łowicz occasionally served as a second capital of the Kingdom, during the periods known as interregnum. The period of prosperity ended after the disastrous Swedish invasion of Poland (1655–1660). The town was visited by Polish kings John II Casimir Vasa and John III Sobieski, as well as Polish national hero Tadeusz Kościuszko. Almost completely destroyed, Łowicz never regained its importance and turned into a small, local town. Nevertheless, it remained a cultural center, as in 1668 one of the first Piarist Colleges in Poland-Lithuania was opened here. One of two main routes connecting Warsaw and Dresden ran through Łowicz in the 18th century and Kings Augustus II the Strong and Augustus III of Poland often traveled that route.