The town of Terespol is located in the spot of a village called Błotków or Błotkowo, which existed in the 16th and 17th centuries. In 1512, this area became property of a nobleman called Iwan Sapieha of Kodeń. Later it belonged to the Hornostaj and Dorohostajski families. Administratively it was part of the Podlaskie Voivodeship until 1566, and the Brest Litovsk Voivodeship afterwards until the Partitions of Poland. In 1609, King Sigismund III of Poland built here a spacious palace with a vast garden. Due to proximity to the city of Brześć Litewski (Brest), the settlement prospered. During Swedish invasion of Poland (1655–1660), Błotków together with the palace were ransacked and burned to the ground by Swedish soldiers.