From 1479, the diocese was administrated by the Archbishops of Magdeburg. While the Halberstadt citizens turned Protestant around 1540, the cathedral chapter elected Prince Henry Julius of Brunswick-Wolfenbüttel first Lutheran bishop in 1566. During the Thirty Years' War, the town was occupied by the troops of Albrecht von Wallenstein in 1629 and temporarily re-Catholicized according to the imperial Edict of Restitution. According to the 1648 Peace of Westphalia, the prince-bishopric was finally secularized to the Principality of Halberstadt held by Brandenburg-Prussia. The first secular governor was Joachim Friedrich von Blumenthal.