Polish Crown Chancellor Andrzej Zamoyski was born there and lived in the palace he built while working on his code of civil laws known as Zbiór praw sądowych.
During Zamojski's residency there, in 1767, Polish–Lithuanian Commonwealth king Stanisław August Poniatowski granted the renewal of the town charter under the Magdeburg rights.
Between 1807 and 1815 it was part of the Polish Duchy of Warsaw, then under the Russian dominion until 1918, when Poland regained independence.
[6] Following the joint German-Soviet invasion of Poland, which started World War II in September 1939, the town was occupied by Germany until 1945.
[7] Expelled Poles were initially held in a camp in Działdowo and then deported to the Kraków District of the General Government in German-occupied southern Poland, while their houses were handed over to German colonists as part of the Lebensraum policy.