Charles XII, sometimes Carl XII (Swedish: Karl XII) or Carolus Rex (17 June 1682 – 30 November 1718 O.S.), was King of Sweden (including current Finland) from 1697 to 1718. He belonged to the House of Palatinate-Zweibrücken, a branch line of the House of Wittelsbach. Charles was the only surviving son of Charles XI and Ulrika Eleonora the Elder. He assumed power, after a seven-month caretaker government, at the age of fifteen.
In 1700, a triple alliance of Denmark–Norway, Saxony–Poland–Lithuania and Russia launched a threefold attack on the Swedish protectorate of Holstein-Gottorp and provinces of Livonia and Ingria, aiming to draw advantage as the Swedish Empire was unaligned and ruled by a young and inexperienced king, thus initiating the Great Northern War. Leading the Swedish army against the alliance Charles won multiple victories despite being usually significantly outnumbered. A major victory over a Russian army some three times the size in 1700 at the Battle of Narva compelled Peter the Great to sue for peace, an offer which Charles subsequently rejected. By 1706 Charles, now 24 years old, had forced all of his foes into submission including, in that year, a decisively devastating victory by Swedish forces under general Carl Gustav Rehnskiöld over a combined army of Saxony and Russia at the Battle of Fraustadt. Russia was now the sole remaining hostile power.
Charles' subsequent march on Moscow met with initial success as victory followed victory, the most significant of which was the Battle of Holowczyn where the smaller Swedish army routed a Russian army twice the size. The campaign ended with disaster when the Swedish army suffered heavy losses to a Russian force more than twice its size at Poltava. Charles had been incapacitated by a wound prior to the battle, rendering him unable to take command. The defeat was followed by the Surrender at Perevolochna. Charles spent the following years in exile in the Ottoman Empire before returning to lead an assault on Norway, trying to evict the Danish king from the war once more in order to aim all his forces at the Russians. Two campaigns met with frustration and ultimate failure, concluding with his death at the Siege of Fredriksten in 1718. At the time, most of the Swedish Empire was under foreign military occupation, though Sweden itself was still free. This situation was later formalized, albeit moderated in the subsequent Treaty of Nystad. The result was the end of the Swedish Empire, and also of its effectively organized absolute monarchy and war machine, commencing a parliamentary government unique for continental Europe, which would last for half a century until royal autocracy was restored by Gustav III.
Charles was an exceptionally skilled military leader and tactician as well as an able politician, credited with introducing important tax and legal reforms. As for his famous reluctance towards peace efforts, he is quoted by Voltaire as saying upon the outbreak of the war; "I have resolved never to start an unjust war but never to end a legitimate one except by defeating my enemies". With the war consuming more than half his life and nearly all his reign, he never married and fathered no children. He was succeeded by his sister Ulrika Eleonora, who in turn was coerced to hand over all substantial powers to the Riksdag of the Estates and opted to surrender the throne to her husband, who became King Frederick I of Sweden.