Branik Castle (Slovene: Grad Branik), also known as Rihemberk Castle (Grad Rihemberk), is a 13th-century castle above the village of Branik, near the city of Nova Gorica in southwestern Slovenia.
Fortified settlements have been present on the hill above what is now the village of Branik since prehistoric times; the site was once occupied by a Roman castrum. The date of the founding of the castle is unclear, but the noble house of Rihemberk (Slovene: Rihemberžani) is first recorded in 1230, originating from Riffenstein in Tyrol, now the castle of Reifenstein in Freienfeld, northern Italy. The name "Rihemberk" derives from the name of the family's former castle, and is a compound of the German words Riffe ("ridge") and Berg ("mountain"). The family received substantial properties in fief from the Counts of Gorizia, including estates in the Vipava Valley, the Kras plateau, in the outskirts of the town of Gorizia and elsewhere. The Rihemberg male line died out in 1371. In the 14th and 15th centuries the lordship contracted to the immediate surroundings of Rihemberk, a small part of the Vipava Valley, and the Kras Plateau. After the Counts of Gorizia died out in 1500, the castle passed to the Habsburgs. In 1528 both it and the surrounding lands were acquired by the noble house of Lanthieri, who added a residential palacio in 1649. The Lanthieris retained the castle for a full 417 years, until World War II. On the night of 22–23 July 1944, partisans resistance fighters assaulted the castle, blew it up and set it on fire, so as to deny its use as an outpost to the German Army. All furnishings were destroyed. In 1945, the castle was nationalized. Since the 1980s, it has since been gradually restored, though all prewar structures have not yet been fully rebuilt.