Castle and town from the southeast. Faithful depiction. The castle, in its role as a border fortress, was called the "key to the Kingdom of Bohemia". The existence of the castle is first documented in 1234, and its construction therefore dates to the time of Václav I and Přemysl Otakar I. From the end of the 16th century, the castle was used as a prison.