Early in 1557, local nobleman, Spytek Wawrzyniec Jordan Trąby coat of arms, owner of Melsztyn castle purchased Opatkowice from the monks of Tyniec abbey. On July 17, 1557 in Vilnius, King Sigismund II Augustus granted Jordan the right to establish a town in Opatkowice with Magdeburg rights at the foot of Melsztyn Castle. In 1558, the village name was changed to "Zakliczyn". By 1581, Zakliczyn was the 10th biggest town in the Kraków Voivodeship, and its cobblers were famous all over Lesser Poland. Zakliczyn prospered in the late 16th and early 17th century (see Polish Golden Age). Together with Melsztyn, the town later belonged to the Zborowski, Sobek and Tarło families in succession. In 1639, the wooden parish church burned down, and Zygmunt Tarło funded a new stone church (1641–50). In early 1615, Zakliczyn again was damaged by fire. In 1652-53 many local residents died in The Plague. On January 5, 1656, during the Swedish invasion of Poland, Zakliczyn was ransacked and burnt down by the Swedes. Despite several royal privileges, tax exemptions and additional fairs, the town never recovered from the destruction. By 1712, it only had 27 artisans. In 1683, King Jan III Sobieski rested here on his way back to Warsaw after the Battle of Vienna.