In the 18th century, the town and region was the subject of Austrian-Prussian wars, eventually passing to Prussia in 1763.[1] The Prussians turned the Piast Castle into a prison.[6] In 1776 the town suffered a fire.[3] On 14 May 1807, during the Napoleonic Wars and Polish national liberation struggles, Polish troops marched through the town, the day before they fought the victorious battle of Struga against the more numerous Prussians.[4] In 1871 along with Prussia the town became part of Germany, and remained within until 1945.