It was annexed by the Kingdom of Prussia in the First Partition of Poland in 1772 and became part of the newly established Province of West Prussia the following year. Prussians liquidated the municipal government and replaced it with new Prussian-appointed administration. In the early 19th century, Prussian authorities acknowledged the town’s Polish-speaking community, ensuring that priests could deliver the sermon in Polish. In 1807, during the Napoleonic Wars, the French entered the town, and in 1812 the Grande Armée marched through the town heading for Russia. Napoleon has visited the town in those years.