Built directly into a rocky cliff face, Predjama Castle was considered virtually impenetrable when it was constructed in the 13th century. However, a few centuries later the structure's fortifications were put to the test when a robber baron started a war with the Habsburgs was forced to hole up in the castle for over a year.

According to legend, Erazem Lueger and his family had taken over the Gothic Predjama castle in the late 14th century. Acquiring land and power, Erazem had become a well-known robber baron in the region. However, he quickly grew too big for his britches, murdering the kinsman of Frederick III, the Holy Roman Emperor. With the strength of all of his forces, Frederick came after Lueger, and forced him into hiding in his castle.

Despite the Emperor's superior forces, the rebellious Lueger had both brains, and a secret tunnel between the castle and the nearby Postojna Cave. For an entire year and one day, Lueger snuck out of the castle and replenished food and drink through the tunnel from a nearby town. Finally, after surviving for so many days, one of his servants sold him out.

Waiting for Lueger to use the outhouse on a high floor of the outside face of the castle, the servant raised a flag and one single shot from a cannon blasted the baron off the toilet.

The castle has been completely reconstructed many times over the years. With a Renaissance-style remaining, the Gothic facade and the legend of Erazem Lueger are often forgotten. However, the Postojna Cave is still in use, allowing visitors to relive the siege and covert activities of a knight who crossed the wrong royal family of Europe.