The period known as Swedish wars (1655–1660) brought destruction of both the town and the Krasnystaw Castle. Following the third partition of Poland, Krasnystaw was in 1795 annexed by the Habsburg Empire, but since 1815 until 1916, it was part of Russian-controlled Congress Poland. During the January Uprising the town and its area saw heavy fighting between Polish rebels and Russian troops.