The first mention of Sanok is found in 12th-century chronicles. The stronghold was destroyed in the 13th century during the Tatar invasion in 1241. In the 14th century the town of Sanok became fortified and a defensive castle was built.
During the reign of King Władysław Jagiełło, his wedding with Elisabeth of Pilica took place at the castle on May 2, 1417. The town and district authorities with a castellan at the top had their seat at the Sanok castle. In 1425, it was established the Higher Court of German law at the Sanok Castle. It was also a residence of the King's fourth wife Sophia of Halshany until her death in 1461.
Queen Bona Sforza ordered the rebuilding of the Gothic castle in the Renaissance style between 1523-1548. Between 1555-1556, the castle was the seat of Isabella Jagiellon, Queen of Hungary, after her escape from Transylvania. At the end of the 16th century, the castle underwent further expansion: the south wing was built at that time. At the turn of the 18th century the north wing was added. During the Napoleonic Wars, the castle was successfully defended against the Austrian forces by General Franciszek Ksawery Krasicki, who was the leader of the anti-Austrian uprising in the Sanok Region.
In 1915, after the Russian invasion, the South wing was demolished. In the interwar period the castle served as the Museum of Sanok. The Museum, established in 1934 by the Society of Friends of the Region of Sanok, had at first collections of the Sanok region, weapons and arms — the history of the town and castle of Sanok, furniture, artistic craftsmanship. With the beginning of World War II in September 1939, the castle was ransacked. In August 1944, the local German authorities looted the oldest surviving monuments of Polish culture, some of which were retrieved by the Polish Government after the war. Its collections were transferred to the castle where, since 1945, they have formed part of the Historical Museum, added to the latter's collection are some 200 icons from Lemko villages.
References:Celje Castle was once the largest fortification on Slovenian territory. The first fortified building on the site (a Romanesque palace) was built in the first half of the 13th century by the Counts of Heunburg from Carinthia on the stony outcrop on the western side of the ridge where the castle stands. It had five sides, or four plus the southern side, which was a natural defence. The first written records of the castle date back to between 1125 and 1137; it was probably built by Count Gunter. In the western section of the castle, there was a building with several floors. Remains of the walls of this palatium have survived. In the eastern section, there was an enclosed courtyard with large water reservoirs. The eastern wall, which protects the castle from its most exposed side, was around three metres thicker than the rest of the curtain wall. The wall was topped with a parapet and protected walkway.