Predjama Castle (Slovene: Predjamski grad or grad Predjama, German: Höhlenburg Lueg, Italian: Castel Lueghi) is a Renaissance castle built within a cave mouth in south-central Slovenia, in the historical region of Inner Carniola. It is located in the village of Predjama, approximately 11 kilometres from the town of Postojna and 9 kilometres from Postojna Cave.
The castle was first mentioned in the year 1274 with the German name Luegg, when the Patriarch of Aquileia built the castle in Gothic style. The castle was built under a natural rocky arch high in the stone wall to make access to it difficult. It was later acquired and expanded by the Luegg noble family, also known as the Knights of Adelsberg (the German name of Postojna).
The castle became known as the seat of the knight Erazem Lueger (or Luegger), lord of the castle in the 15th century and a renowned robber baron. He was the son of the Imperial Governor of Trieste, Nikolaj Lueger.
According to legend, Erazem came into conflict with the Habsburgs when he killed the commander of the Imperial army, Marshall Pappenheim, who had offended the honour of Erazem's deceased friend, Andrej Baumkircher of Vipava. Fleeing the vengeance of the Holy Roman Emperor, Frederick III, Erazem reached the family fortress of Predjama. From there, he allied himself with King Matthias Corvinus and began to attack Habsburg estates and towns in Carniola. The emperor commissioned the governor of Trieste, Andrej Ravbar, with the capture or killing of Erazem. Erazem was killed after a long siege. Erazem was betrayed by one of his men and was killed by a shot from a cannon.