From the early Middle Ages to 1809, Finland was part of the Kingdom of Sweden, and its official language was Swedish. Finnish did not become an official language until 1863. In 2002,93.4% of the population was primarily Finnish-speaking, and5.9% was primarily Swedish-speaking. Swedish-speaking Finns make up more than 95% of the population of the Åland Islands and Swedish-speaking majorities are also found in parts of Uudenmaan, Turun-Porin, and Vaasan provinces. Swedish, the second legal language, is given constitutional safeguards. Only a minority of individuals have another language as their mother tongue, principally Lapp, Russian, English, or German. Finnish belongs to the Finno-Ugric language group and is closely related to Estonian; more distantly to the Komi, Mari, and Udmurt languages spoken among those peoples living in Russia; and remotely to Hungarian.