St. Anne church in the Old Town The settlement was first located in 1325 but was soon after destroyed by
Lithuanians. The rebuild settlement was granted town rights in 1364. It was known at the time as
Wartberg. In 1440 the town joined the
Prussian Confederation, at the request of which Polish King
Casimir IV Jagiellon signed the act of incorporation of the region to the
Kingdom of Poland in 1454. In 1466, after the
Second Peace of Toruń, the town was confirmed as part of Kingdom of Poland. It was the place of fights of the
Polish–Teutonic War of 1519–1521. In April 1520 a battle was fought in the vicinity, in November 1520 the town was successfully defended by the Poles, and in January 1521 the Teutonic Knights came back and launched artillery fire on the town, but eventually withdrew.
Gerard Labuda and
August von Haxthausen give the number of 1500 Poles and 590 Germans living in the town in 1825. According to this was part of Prussian repressions against Poles as the monastery was seen as particularly problematic by Prussian authorities for being a center of
Polish resistance. A Jewish Synagogue was built in 1847, and a Jewish cemetery from the 19th century exists as well. In 1885 a mass rally was organised by Poles, demanding among others that Polish children should be allowed to use their language in education In 1886 a bookstore with Polish books and publications was opened in the town and came into conflict with German authorities who wanted it to remove Polish language signs. In the
plebiscite of 1920 3,020 inhabitants voted to remain in
Weimar German East Prussia, 140 votes supported reborn Poland. In the interwar era the town was the residence of the fictional Kuba spod Wartemborka, a pseudonym of a figure in Polish press in Warmia created by which ridiculed
Germanisation efforts against Poles in the region. Polish organisations continued to thrive in the town, up until
Second World War; as
Nazi Party was elected to power in Germany, repressions intensified, eventually many Polish activists were either imprisoned or, like Pieniężny, murdered in
Nazi concentration camps and
prisons. During that war, the remaining Jewish community was murdered in the
Holocaust. During the war, the German administration operated a Nazi prison in the town, with several
forced labour subcamps in the region, including one in the town itself. Many inhabitants fled the town since 21 January 1945, and the last German units withdrew during the night of 30–31 January. ==Historical population==