Ferdinand unable to help, John George of Saxony signed a six-month truce with Sweden in September, followed by the March 1646 Treaty of Eulenberg in which he agreed to remain neutral until the end of the war. Under Turenne, French commander in the Rhineland, and Wrangel, who had replaced Torstenson, the French and Swedes separately invaded Bavaria in the summer of 1646. Maximilian was soon desperate to end the war he was largely responsible for starting, at which point the Spanish publicised a secret offer by Mazarin to exchange French-occupied Catalonia for the Spanish Netherlands. Angered by this duplicity, the Dutch agreed a truce with Spain in January 1647 and began to negotiate their own peace terms. Having failed to acquire the Netherlands through diplomacy, Mazarin decided to do so by force and to free up resources, on 14 March 1647 he signed the Truce of Ulm with Bavaria, Cologne and Sweden. The offensive was to be led by Turenne, but the plan fell apart when his mostly German troops mutinied, while Bavarian general Johann von Werth refused to comply with the truce. Although the mutinies were quickly suppressed, Maximilian felt obliged to follow Werth's example and in September ordered Bronckhorst-Gronsfeld to combine the remnants of the Bavarian army with Imperial troops under von Holzappel. Outnumbered by a Franco-Swedish army led by Wrangel and Turenne, they were defeated at Zusmarshausen in May 1648 and von Holzappel was killed. Although the bulk of the Imperial army escaped thanks to an effective rearguard action by Raimondo Montecuccoli, Bavaria was left defenceless once again. The Swedes sent a second force under von Königsmarck to attack Prague, seizing the castle and Malá Strana district in July. The main objective was to gain as much loot as possible before the war ended; they failed to take the Old Town but captured the Imperial library, along with treasures including the Codex Gigas, now in Stockholm. When a Spanish offensive in Flanders ended with defeat at Lens in August 1648, Ferdinand finally agreed terms and on 24 October, he signed peace treaties with France and Sweden, ending the war. The conflict outside Germany Northern Italy Parts of northern Italy, which were part of the Kingdom of Italy, had been contested by France and the Habsburgs since the end of the 15th century, as it was vital for control of south-west France, an area with a long history