Dominating over the old town, Idrija's castle has preserved its historical name, Gewerkenegg, which in German means mine castle. It was built in the period from 1522-1533 for the needs of the mercury mine. Initially used to store wheat and mercury, the castle was later occupied by the mine administration for more than 400 years. Over the centuries, it has also housed various offices, schools and residents. In the mid 18th century, the Renaissance castle complex with its three round corner towers and single front tower was renovated in baroque style and painted with decorative frescoes. Its present-day appearance dates back to the first half of the 1990's. Today, the castle is used for museum activities, the music school and, to a smaller extent, restaurants and shops.