Modern Sweden emerged out of the Kalmar Union formed in 1397, and by the unification of the country by King Gustav Vasa in the 16th century. In the 17th century the country expanded its territories to form the Swedish empire. Most of the conquered territories outside the Scandinavian Peninsula, were lost during the 18th and 19th centuries. The eastern half of Sweden constituted by the eastern half of Norrland and Osterland was lost to Russia in 1809. The last war in which Sweden was directly involved was in 1814, when Sweden by military means forced Norway into a personal union with Sweden, a union which lasted until 1905. Since 1814, Sweden has been at peace, adopting a non-aligned foreign policy in peacetime and neutrality in wartime.