It was a royal possession from then until 1386 when Polish King Władysław II Jagiełło gave it to Sędziwój Pałuka [pl] from Szubin.
In 1581 King Stephen Báthory granted the town the right to hold trade fairs.
In 1771 General Jan Lipski[4] began building a palace,[5] adjacent to the town, which was completed in 1780.
Following the successful Greater Poland uprising of 1806, it was regained by Poles and included within the short-lived Duchy of Warsaw.
During the invasion of Poland, which started World War II in September 1939, the town was invaded and then occupied by Germany.