The castle was built in the 1520s to serve as the administrative headquarters of the Idrija mine. This award-winning Municipal Museum is housed inside.