In 1526 Piekary came under the suzerainty of the Habsburg Monarchy. Polish King John III Sobieski visited Piekary in 1683, while rushing to the relief of Vienna during the Ottoman invasion. The next years brought several peasant revolts against the German magnates. In 1697, newly elected King of Poland Augustus II the Strong stopped in Piekary before his royal coronation in Kraków. He converted to Catholicism in the local church and at the same time he sworn the pacta conventa. In January 1734, his son, elected king Augustus III of Poland, also stopped here, while heading for his royal coronation, and also swore the pacta conventa here.