Swedish Wars on Bremen

The Swedish Wars on Bremen were fought between the Swedish Empire and the Hanseatic town of Bremen in 1654 and 1666. Bremen claimed to be subject to the Holy Roman Emperor, maintaining Imperial immediacy, while Sweden claimed Bremen to be a mediatised part of her dominions of Bremen-Verden, themselves territories immediately beneath the emperor. Sweden was able to gain some territory, but despite forcing a formal oath of allegiance on Bremen, did not gain control of the town.
Background.
When in 1648 the Peace of Westphalia ended the Thirty Years' War, the parties agreed that the prince-bishoprics of Bremen and Verden were to become dominions of Sweden. The peace treaty had been prepared at a congress throughout the final years of the war.
During the negotiations, several mostly Hanseatic cities requested that they become Imperial cities, with only Bremen being successful: Ferdinand III, Holy Roman Emperor accepted Bremen as a Free imperial city in 1646. A respective document was signed in Linz on 1 June, with the aim of preventing Sweden from gaining the city. In turn Bremen, among other concessions, paid about 100.000 talers. Owing to Swedish diplomatic efforts however, the text of the 1648 treaty did not determine whether or not Bremen was to be included in the future Swedish dominion.
The Prince-Archbishopric of Bremen, northerly and easterly neighbouring the city's territory, had been occupied by Sweden since 1646/47. Swedish forces had then expelled the forces of Prince-Archbishop Frederick II, Prince of Denmark, officiating from 1637 to 1648. On 18 February 1647, the emperor accepted Sweden's annexation of the prince-archbishopric's territory as a secularized duchy.
After the war a dispute about custom collection between Bremen and the emperor led to the latter imposing an Imperial ban on the city in 1652/53. Sweden, which had never accepted Bremen's Imperial immediacy, attacked in 1654.
First war (1654).
Swedish forces commanded by Hans Kristofer von Königsmark occupied part of the territory held by the city, but did not attack the city itself. Bremen recruited mercenaries and strengthened its defensive works. Without engaging in any major confrontation, the parties agreed on the on 28 November. It was agreed that Sweden kept occupied Bederkesa and Lehe, and Bremen had to pledge allegiance to the Swedish king Charles X Gustav. Bremen did so on 6 December.
Second war (1666).
In 1665, Bremen refused to pledge allegiance to Charles X Gustav's successor, Charles XI of Sweden. In March, the Swedish riksråd decided to wage war. Thereupon, 12,000 Swedish troops were transferred to the Duchy of Bremen by the end of the year. In January 1666, Carl Gustaf Wrangel departed from Swedish Pomerania to command the Swedish army, which in early 1666 numbered 14,000 troops. By summer, all of the city of Bremen's territory was occupied, except the city itself.
The Swedish chancellor of Bremen-Verden, Esaias von Pufendorf, went to the court in Paris to build an alliance with France. The Swedish position was that France had to intervene on the Swedish side, since Bremen was Swedish according to the Peace of Westphalia, of which France was a guarantor. Pufendorf was, however, told by Hugues de Lionne that France would not hesitate to declare openly that she read the treaty as Bremen being an Imperial city, rather than provoke a new great war with the Holy Roman Empire and the Dutch Republic with an assault Sweden and France could hardly win. Lionne said Sweden would be better off waiting for a situation when the Dutch and the neighboring German principalities were weak, and then take the city of Bremen by surprise.
The city of Bremen on the other side was successful in gathering allies, most notably Brunswick-Lüneburg (Celle) and the Electorate of Cologne, who raised a relief army. Brandenburg, Denmark and the Dutch Republic joined the anti-Swedish alliance. Wrangel failed to take the city, and initiated negotiations at his headquarters in Habenhausen. On 14 November, the Peace of Habenhausen was signed: Swedish Bremen-Verden was obliged to destroy the fortresses built close to the city. Bremen had to dispense with its status as an Imperial city during the contemporary sessions of the Imperial Diet, which were scheduled to last until the end of the 17th century. Bremen was also banned from emitting representatives to the Diet of the Lower Saxon Circle. What could not be foreseen at the time of the peace was that the Imperial Diet was to become the "Perpetual Diet of Regensburg", lasting until the dissolution of the Holy Roman Empire in 1806. Bremen further had to cede its territories north of the city and at the lower Weser river. However, the city itself with a number of villages around, maintained its independence. When in 1700 Charles XII of Sweden asked "Bremen-Verden's General Government" what to do about Bremen's independence, the General Government recommended to concede its status as a "Free Imperial City".
Aftermath.
In 1672, Sweden founded Carlsburg at the confluence of the Weser and Geeste rivers to compete with Bremen, but the settlement did not prosper. Sweden later lost all of Bremen-Verden during the Great Northern War (1700–1721).