 After the great depression of the Thirteen Years' War, new economical growth in the town was slow before the middle of the 16th century; the progress was hampered by the religious struggle, and by the Polish–Swedish wars throughout the 17th century.At the end of 1655 the town and its castle were captured by the Swedes, who held them occupied for four years.In 1659 the Swedes had been besieged for several days and retreated.