The Niepołomice Castle was built by order of King Casimir III the Great on the slope of the Vistula valley, to serve as a retreat during the hunting expeditions to the nearby Niepołomice Forest. The castle consisted of three towers, buildings in the southern and eastern wing, and curtain walls around the courtyard. Sigismund I the Old rebuilt the structure, giving it the form of a quadrangle with an internal courtyard. Queen Bona Sforza's gardens were located on the southern flank. In 1550 the great fire destroyed the east and north wings. The reconstruction works were conducted in 1551-1568 under the supervision of Tomasz Grzymała and a sculptor Santi Gucci. Since the end of the 16th century the castle passed into the hands of noble families of Curyło, Branicki and Lubomirski. At that time, only the small changes were made in the castle's interiors (fireplaces, ceilings). The construction of an arcade courtyard began in 1635 and was completed in 1637. The Swedish-Brandenburgian invasion in 1655 brought an end to the magnificence of the building. The castle was transformed into a food store during the occupation. In the 18th century it was acquired by King Augustus II the Strong and Augustus III. The reconstruction of the former royal residence began in 1991, when it became the property of Niepołomice Municipality.