During the Great Northern War, Stenbock served under King Charles XII in his military campaigns in the Baltic and Polish fronts. As director of the General War Commissariat, Stenbock collected substantial funds and supplies for the maintenance of the Swedish army, earning the admiration of Charles XII. In 1705 he was appointed general of the infantry and Governor General of Scania. As acting governor, Stenbock displayed his administrative skills and organized Scania's defense against an invading Danish army, which he defeated at the Battle of Helsingborg in 1710. In 1712, he conducted a campaign in northern Germany and defeated a Saxon-Danish army at the Battle of Gadebusch, which earned him his field marshal's baton. His career plummeted after his merciless destruction of the city of Altona in 1713. Surrounded by overwhelming allied troops, Stenbock was forced to surrender to King Frederick IV of Denmark during the siege of Tönning. During his captivity in Copenhagen, the Danes revealed Stenbock's secret escape attempt and imprisoned him in Kastellet. There he was the subject to a defamation campaign conducted by Frederick IV and died in 1717 after years of harsh treatment.