Freistadt Castle (German: Schloss Freistadt) in Upper Austrian Mühlviertel was built, together with its bergfried, between 1363 and 1398, and was used to reinforce the fortifications of the town of Freistadt. Today the castle houses the tax office and the Mühlviertel Castle Museum.
The building of the castle was begun in 1363 in order to bolster the town's fortifications, Duke Rudolph IV the Founder issuing the orders for its construction. Until it was completed, all the manner of estates within the jurisdiction (Landgericht) of Freistadt were taxed: homes, land, fiefs and farmsteads. After Rudolph's death in 1365, his brothers, Leopold and Albert, continued with the work, and in 1397/98 the new castle and its bergfried were finished. Several improvements continued until 1440 and, in the late 15th century, the height of the bergfried was raised.
The schloss replaced the old castle in Salzgasse street, the Altenhof (today: the Salzhof). From then on the new castle was used by the territorial princes as an administrative centre for the Barony and District of Freistadt (including inter alia Leopoldschlag, Neumarkt, Schenkenfelden and Rainbach) and as the residence of the lord's Pfleger. The other district office for the Barony of Freistadt was Schloss Haus (from the 18th century). With the simultaneous expansion of the remaining fortifications, the castle strengthened the defensive capability of the town. Nevertheless, the castle was the weakest point in its lines of defence.
Entry to the castle was achieved then as now in two ways. On one side, access was gained through a gateway to the main courtyard and, on the other, through another gateway at the end of the Schlossgasse leading from the Böhmergasse into the outer courtyard. The castle itself was further separated from the town by a moat and drawbridge. Even the adjoining townhouses were not allowed to have a door into the outer courtyard. The castle was also protected from the town and possible attacks from that direction.
During the Hussite Wars and the numerous border feuds of the 15th century the castle acted as a strong bulwark at the edge of the town. In the 16th century it was significantly remodelled, the plans for the rebuilding of the south wing in 1588 being drawn up by architects Antonio Cerisora, Ambrosio Solari and Mert Pogner. Around 1594 the castle acted as a refuge for the surrounding population during the Turkish Wars. Only once was the castle plundered by besieging troops, in 1626, when rioting peasants captured the town and the castle. The castle's governor and three Capuchin monks were locked in the castle chapel and mistreated. Liturgical objects were stolen and all the boxes and chests broken open and looted.
In the course of time there was also opposition between the town and the castle. One sticking point was a "back door" (Hintertürl) that led from the castle into the zwinger and over the town moat out of the town; something that had been planned even at the design stage. This enabled residents of the castle to leave the town incognito, but the gate also posed a security risk, which is why it had been bricked up in the 15th century. In 1584, Hans Christoph von Gera pressed for the opening of the gate by drawing attention to the lack of escape during the two great fires of 1507 and 1516. Finally the territorial prince ruled in favour of the town and that the gate should be left walled up.