During the Polish-Swedish War the Swedish King Gustav II of stayed in the town during 1626. Two large fires, in 1634 and 1694, partially destroyed the town. The town was revived at the turn of the 17th and 18th centuries after the end of Polish-Swedish wars.