The town was formerly called Derbolfing; a knightly family named "Zirke" is mentioned there as Andechs ministerials at the end of the 12th century. These knights may have been the founders of the first castle seat. When the Wittelsbach dukes sought to expand their power in southern Bavaria, this led to conflict with the Andechs counts. In the ensuing battles, the Wittelsbachs prevailed and, from the middle of the 13th century, also took control of Derbolfing. In 1272, Duke Ludwig the Strict was granted estates there by the Bishop of Freising, and by 1293, the entire town was under ducal rule. The likely existing castle was subsequently expanded and renamed Grünwald. Grünwald Castle soon lost its strategic importance. In 1348, a document officially states that it was used only "for hunting and other recreational purposes." Duke John II interpreted this in his own unique way – his lover gave birth to a son here in 1392, who, as Johannes Grünwalder, rose to the throne of the Freising bishopric. Duke Sigismund also later used Grünwald as a discreet seat for his love affairs. The castle only experienced rougher times once. In 1398, the citizens of Munich rose up against the dukes. The ensuing siege, however, appears to have been relatively harmless: provocative gestures were all that was involved, and no major fighting is documented.
Duke Albrecht the Wise had Grünwald extensively expanded again from 1486 onwards – as a romantic knight's residence, whose military appearance was essentially mere decoration. His successors lost interest, and Grünwald fell into a deep sleep. Because the slope of the Isar River began to slide, several buildings, including the Pallas, had to be demolished in the 17th century. In 1698, the castle was converted into a prison for noble criminals. The murals of an inmate who, typical of the time, wreaked havoc throughout Europe as a "goldsmith" and alchemist can still be admired today. From 1798, it served as a powder depot and ammunition depot. In 1879, the romanticism of chivalry returned: the sculptor Paul Zeiler acquired the complex, organized historical festivals, and had the large tower restored. In 1978, the state finally took over, extensively renovated, and established a museum that had just been completely redesigned.