Sweden and Norway or Sweden–Norway (Swedish: Svensk-norska unionen; Norwegian: Den svensk-norske union), officially the United Kingdoms of Sweden and Norway, or as the United Kingdoms, was a personal union of the separate kingdoms of Sweden and Norway under a common monarch and common foreign policy that lasted from 1814 until its amicable and peaceful dissolution in 1905.
The two states kept separate constitutions, laws, legislatures, administrations, state churches, armed forces, and currencies; the kings mostly resided in Stockholm, where foreign diplomatic representations were located. The Norwegian government was presided over by viceroys: Swedes until 1829, Norwegians until 1856. That office was later vacant and then abolished in 1873. Foreign policy was conducted through the Swedish foreign ministry until the dissolution of the union in 1905.
Norway had been in a closer union with Denmark, but Denmark-Norway's alliance with Napoleonic France caused the United Kingdom and Russia to consent to Sweden's annexation of the realm as compensation for the loss of Finland in 1809 and as a reward for joining the alliance against Napoleon. By the 1814 Treaty of Kiel, the King of Denmark-Norway was forced to cede Norway to the King of Sweden. But Norway refused to submit to the treaty provisions, declared independence, and convoked a constituent assembly at Eidsvoll in early 1814.
After the adoption of the new Constitution of Norway on 17 May 1814, Prince Christian Frederick was elected king. The ensuing Swedish-Norwegian War (1814) and the Convention of Moss compelled Christian Frederick to abdicate after calling an extraordinary session of the Norwegian Parliament, the Storting, to revise the Constitution in order to allow for a personal union with Sweden. On 4 November the Storting elected Charles XIII as the King of Norway, thereby confirming the union. Continuing differences between the two realms led to a failed attempt to create a separate Norwegian consular service and then, on 7 June 1905, to a unilateral declaration of independence by the Storting. Sweden accepted the union's dissolution on 26 October. After a plebiscite confirming the election of Prince Carl of Denmark as the new king of Norway, he accepted the Storting's offer of the throne on 18 November and took the regnal name of Haakon VII.
Sweden and Norway had been united under the same crown on two occasions: from 1319 to 1343, and briefly from 1449 to 1450 in opposition to Christian of Oldenburg who was elected king of the Kalmar Union by the Danes. During the following centuries, Norway remained united with Denmark in a close union, nominally as a kingdom, but in reality reduced to the status of a province, ruled by Danish kings from their capital Copenhagen. After the establishment of absolutism in 1660, a more centralised form of government was established, but Norway kept some separate institutions, including its own laws, army and coinage. The united kingdoms are referred to as Denmark-Norway by later historians.
Sweden broke out of the Kalmar Union permanently in 1523 under King Gustav Vasa, and in the middle of the 17th century rose to the status of a major regional power after the intervention of Gustavus II Adolphus in the Thirty Years' War. The ambitious wars waged by King Charles XII, however, led to the loss of that status after the Great Northern War, 1700–1721.
Following the break-up of the Kalmar Union, Sweden and Denmark-Norway remained rival powers and fought many wars, during which both Denmark and Norway had to cede important provinces to Sweden in 1645 and 1658. Sweden also invaded Norway in 1567, 1644, 1658 and 1716, to wrest the country away from the union with Denmark, and either annex it, or form a union. The repeated wars and invasions led to popular resentment against Sweden among Norwegians.