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.