At the beginning of the fourteenth century, the Bishop of Kraków, Bodzanta, built a wooden mansion on a hill above the Psarką river. This manor house was destroyed fairly quickly and the later Bishop of Kraków Florian Mokrski erected a stone castle on a hill, surrounded by a moat. One of the greatest events in the history of the castle took place in 1410 when King Wladyslaw Jagiello visited it on pilgrimage to the Holy Cross before the Battle of Grunwald.