Principality of Brunswick-Wolfenbüttel
Stapelburg Castle was first mentioned in a 1306 deed as a property of the Counts of Wernigerode; it was meant to protect and control the trade route to the Imperial City of Goslar near the border with the Principality of Brunswick-Wolfenbüttel. Prior to that an Imperial castle, mentioned as Ahlsburg in the 14th century, was erected a few kilometres south-southwest in the Harz mountains on a spur high above the Ecker valley.