The royal fortress Henry IV raised in the Harz, besieged and then levelled by the Saxons in 1073-1074, and the castle in which Otto IV died in 1218.
The Harzburg stands on a wooded spur of the northern Harz above the modern town of Bad Harzburg, a few kilometres from the royal palace at Goslar and the silver mines of the Rammelsberg that paid for it. Henry IV had it built between 1065 and 1068, to a design attributed to Bishop Benno II of Osnabrück, and it was the largest of a ring of castles he raised across Saxony.
Its purpose was frankly political. The Salian kings drew much of their wealth from the Harz, and the castles were intended to hold a region whose nobility regarded royal power as an intrusion. The Harzburg was also meant as a dynastic centre: Henry endowed a collegiate church inside the walls, brought relics to it, and made a family vault there in which his brother Conrad and an infant son were buried.
The castles were built with forced labour and garrisoned by ministerials from Swabia, outsiders who provisioned themselves at local expense. Saxon complaint focused on exactly this: not a theory of kingship but requisitioning, service owed and strangers in arms on their own hills.
The revolt broke out on 29 June 1073, when the Saxon nobility assembled under Otto of Nordheim and moved on Goslar. Henry fell back to the Harzburg with the imperial regalia and a garrison the chroniclers number at a few hundred, and was besieged there by a force vastly larger. He escaped by night in August, slipping out through the woods with the regalia and making his way south to safety.
Unable to fight the Saxons, Henry negotiated. By the terms agreed at Gerstungen in February 1074 he undertook to slight his Saxon castles, and the walls and towers of the Harzburg were duly pulled down.
That was not enough for the Saxon peasantry, who had supplied the labour and resented the place most. In the spring of 1074 they went up the hill and destroyed what remained, breaking into the collegiate church, wrecking it, and opening the royal graves — the bones of Henry's brother and his infant son were thrown out. The sacrilege turned opinion across the empire sharply against the Saxons, handed Henry a moral advantage he had entirely lacked, and contributed to his victory over them the following year.
The castle was rebuilt and remained a royal and then an imperial possession through the twelfth century, held under the Hohenstaufen and contested with the Welfs, whose power was centred on Brunswick and the Harz foreland.
It passed to the Welf side with Otto IV, the only Welf to be crowned emperor. The fortress he held at the end of his life was therefore the rebuilt one, on the same spur but not the buildings Henry IV knew.
Otto IV's reign effectively ended at the Battle of Bouvines on 27 July 1214, where the coalition he led with King John of England was destroyed by Philip II of France. Excommunicated by Innocent III and abandoned for the young Frederick II, he withdrew to his family lands in Saxony and ruled nothing but them.
He died at the Harzburg on 19 May 1218 and was buried at Brunswick. His brother Henry handed the imperial regalia over to the Hohenstaufen, and with them went the last claim of the Welf line to the empire — the second time in a century and a half that the Harzburg had been the place where a ruler's control of those regalia was decided.