In the Thirty-year War Goslar belonged to the loyalists of the Emperor, although its territory belonged to a Protestant region. The Swedish King Gustav II Adolph punished Goslar for supporting the imperial forces. After 1642 Goslar came under the rule of the Welfs.