First stronghold was built here in the early 12th century, during the reign of Bolesław III Wrymouth. In 1241, during the Mongol invasion of Poland, it was burned and destroyed, and in the mid-14th century, new, stone complex of a mighty Gothic castle was built here. The castle guarded western border of Lesser Poland, and in 1470 it was purchased by the Salomon family, merchants from Kraków. It then changed hands several times, belonging to the Rzeszowskis, Pileckis, Chełmińskis and finally, the Boner family (since 1523). In 1530 - 1545, Seweryn Boner turned the Gothic stronghold into a Renaissance residence. In 1562, Boner's daughter Zofia married Jan Firlej, and the castle, as a dowry, changed hands once more. In 1587, it was captured by Maximilian III, during the War of the Polish Succession. In 1655, it was seized by Swedes (see Deluge). Swedish garrison stayed at the castle for two years, which resulted in its extensive damage. In 1669, the castle was partially restored by its new owner, castellan of Kraków Stanisław Warszycki. In 1695 it was purchased by the Męciński family, and in 1702, once again it was destroyed by Swedish soldiers, during the Great Northern War. After the destruction, the castle remained a ruin, and its subsequent owners could not afford to rebuild the complex. It remained inhabited until circa 1810.
