The land area that now makes up Finland was settled immediately after the last ice age, which ended in 9000 BC. Most of the region was a part of the Kingdom of Sweden from the 13th century to 1809, when the vast majority of the Finnish-speaking areas of Sweden were ceded to the Russian Empire (excluding the Finnish-speaking areas of the modern-day Northern Sweden), making this area the autonomous Grand Duchy of Finland. The Lutheran religion dominated. Finnish nationalism emerged, focused on Finnish cultural traditions, including music and—especially—the highly distinctive language and lyrics associated with it. The catastrophic Finnish famine of 1866–1868 was followed by eased economic regulations and extensive emigration.
In 1917, Finland declared independence. A civil war between the Finnish Red Guards and the White Guard ensued a few months later, with the "Whites" gaining the upper hand during the springtime of 1918. After the internal affairs stabilized, the still mainly agrarian economy grew relatively quickly. Relations with the West, especially Sweden and Britain, were strong but tensions remained with the Soviet Union. During the Second World War, Finland fought twice against the Soviet Union and defended its independence, though in the 1947 peace settlement, it ended up ceding a large part of Karelia and some other areas to the Soviet Union. However, Finland remained an independent democracy in North Europe.
In the latter half of its independent history, Finland has maintained a mixed economy. Since its post-World War II economic boom in the 1970s, Finland's GDP per capita has been among the world's highest. The expanded welfare state of Finland from 1970 and 1990 increased the public sector employees and spending and the tax burden imposed on the citizens. In 1992, Finland simultaneously faced economic overheating and depressed Western, Russian, and local markets. Finland joined the European Union in 1995, and replaced the Finnish markka with the euro in 2002. According to a 2005 poll, most Finns at that point were reluctant to join NATO.