In the Middle Ages the Lower Carniola was a constituent part of the March of Carniola, and its wine was named Marvin (from German Marwein from Markwein), which was also mentioned by Valvasor, a seventeenth-century Slovenian historian.
According to Valvasor, the castle was built in the late 13th century by the noble Rabensbergs from Koprivnik.