The Stapelburg was built before 1306 by the Counts of Wernigerode to guard the military road that connected the counts' main ancestral castle with the imperial and mining town of Goslar. It also acted as a toll station. The castle was enfeoffed several times and in 1394 came into the possession of the Diocese of Halberstadt for a sum of 600 marks. On 25 January 1432, Count Botho of Stolberg accepted Stapelburg Castle and its estate from Bishop John of Halberstadt as a pledge, after it should have been previously enfeoffed to the last Wernigerode count who had died in 1429. But Stapelburg was redeemed again by the Diocese of Halberstadt and pledged to Heinrich von Bila, who was the last vassal before Stapelburg was enfeoffed by Bishop Gebhard von Halberstadt on 4 June 1463 for 200 Rhenish guilders to Count Henry the Elder of Stolberg for the duration of his life - that is until 1511. During his final years the castle fell somewhat into ruin. On 13 April 1509 the aging Count Botho and his son committed to the administrator of the Bishopric of Halberstadt, Archbishop Ernest of Magdeburg, to rebuild the dilapidated castle within eight years, so that a nobleman or steward could have his seat there. As a result, the count of Stolberg and his son were enfeoffed with the Stapelburg. In 1559 Archbishop Sigismund of Magdeburg, as the administrator of the Bishopric of Halberstadt, installed an influential member of the family of Bila, former Halberstadt councillor, Dr. Heinrich von Bila, who worked as an associate judge on the Imperial Chamber Court, in the Stapelburg, against the will of the heavily indebted counts of Stolberg. He expanded the castle and had the outlying estate of Bilenshausen or Bilashausen laid out at its foot. In the immediate vicinity of this outwork a rural settlement grew up that also adopted the name Stapelburg. The heirs of Dr. von Bila sold the castle and village of Stapelburg in 1596 for 45,000 talers to Statius von Munchausen. After Statius' bankruptcy in 1619 possession of the castle went again in 1625 to Halberstadt Cathedral. After long negotiations with the cathedral chapter of Halberstadt, Count Christian Ernest of Stolberg-Wernigerode who succeeded, in a Berlin agreement on 11 March 1722, in securing Stapelburg permanently as an appurtenance of the County of Wernigerode for the next few centuries. King Frederick William I of Prussia restored its old connection with the County of Wernigerode on 11 December 1727 by removing the territorial claims of the now Prussian Halberstadt Cathedral Chapter.