At the time of the Great Northern War, the northwest of the Holy Roman Empire was a patchwork with the Swedish dominion of Bremen-Verden located between the largely autonomous cities of Bremen and Hamburg, bordered to the south by the Electorate of Hanover, whose prince-elector George Louis became king of Great Britain in 1714, and to the north by the Duchy of Holstein, divided into Holstein-Glückstadt, ruled by the Danish king, and Holstein-Gottorp, whose duke Charles Frederick, a cousin and ally of Charles XII of Sweden, resided in Stockholm while Danish forces had occupied his share of the duchy only disturbed by Stenbock's march from Wakenstädt to Tønning in 1713. Hamburg and Bremen were crowded with refugees of war, and Bremen in addition was suffering from a smallpox epidemic that had caused the deaths of 1,390 children in 1711.