Charles IV, Holy Roman Emperor, built Karlstein Castle during the mid-1300s. It was constructed to protect the Crown Jewels, other treasures and to keep people out. The main building is protected behind two walls, secured with two gates and surrounded by a moat.