The castle was built between 1240 and 1250 on the Schönberg by Walter I of Geroldseck as the ancestral castle of the Lords of Geroldseck. Between the division of the land in 1277 and the end of the Geroldseck dominion in 1634, it formed the center of the "Upper Dominion" of Hohengeroldseck. The territory of the upper Ortenau was in the hands of the descendants of Walter von Geroldseck from 1277 and included the dominions of Lahr, Mahlberg, Schiltach as well as the monastery of Schuttern and the monastery of Ettenheimmünster. Also in the possession of the Lords of Geroldseck was the bailiwick on both sides of the Rhine from Basel to Seltz. In 1442, Margrave Jakob I of Baden bought half of the dominion of Lahr and Mahlberg from the descendants of Walter von Geroldseck for 30,000 gulden. In 1486 the castle was conquered by Count Palatine Philip and remained with the Electorate Palatinate until 1534. The Elector Palatine gunner Martin Merz led the shelling in 1486, which lasted six weeks. In 1599, the Geroldsecker moved their residence to Dautenstein Castle in nearby Seelbach, which was converted into a Renaissance palace.