The town of Kostel is located in the Kupa River Valley and was first mentioned in records in the year 1336 as “Castrum Grafenwarth,” signifying a fortress or stronghold. Later, in 1449, it was mentioned as “Costel.” In the place of today’s castle, there once stood a fortress that the Habsburgs further fortified between 1247 and 1325 to secure their properties extending from Čušperk to the Kupa River.
After the death of Count Frederick II on April 28, 1418, the castle came into the possession of the Counts of Celje, who expanded and rebuilt it into one of the largest fortresses in the region of Carniola. The castle was named “Grauenwarth,” while the square and the area below retained the name Kostel. Historical records indicate that the town of Kostel was so significant that it had its own court with the authority to pass death sentences. Following Ulrik II’s death in 1456, the castle once again became the property of the Habsburg dynasty and gained the right to hold its own fairs. This castle served as a defense against various invaders and, later, in defense against the Ottoman Empire’s forces, whose campaigns are described in the mythology of the Kupa Valley as one of the greatest achievements in the local legend of Petar Klepec.