Finland was a province and then a grand duchy under Sweden from the 12th to the 19th centuries, and an autonomous grand duchy of Russia after 1809. It won its complete independence in 1917. During World War II, it was able to successfully defend its freedom and resist invasions by the Soviet Union - albeit with some loss of territory. In the subsequent half century, the Finns made a remarkable transformation from a largely agricultural and logging-based economy to a diversified modern industrial economy; per capita income is now among the highest in Western Europe. A member of the European Union since 1995, Finland was the only Nordic state to join the euro system at its initiation in January 1999. In the 21st century, the key features of Finland's modern welfare state are a high standard of education, equality promotion, and national social security system - currently challenged by an aging population and the fluctuations of an export-driven economy.