Charles XII, sometimes Carl XII (Swedish: Karl XII) or Carolus Rex (17 June 1682 – 30 November 1718 O.S.), was King of Sweden 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 take advantage of the Swedish Empire being 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 significantly outnumbered. A major victory over a much larger Russian army in 1700, at the Battle of Narva, compelled Peter the Great to sue for peace, an offer that Charles subsequently rejected. By 1706, Charles, now 24 years old, had forced all of his foes into submission. That year, Swedish forces under general Carl Gustav Rehnskiöld won a decisive victory over a combined army of Saxony and Russia at the Battle of Fraustadt. Russia was now the sole remaining hostile power.