Humans have lived in Norway for about 10,000 years, but only since the early centuries of the Christian era have the names of tribes and individuals been recorded. This was the period when small kingdoms were forming; the name Norge ("Northern Way") was in use for the coastal district from Vestfold to Hålogaland before AD 900. The Viking period (800–1050) was one of vigorous expansion, aided by consolidation of a kingdom under Olav Haraldsson.
From the death of Olav in 1030, the nation was officially Christian. During the next two centuries—a period marked by dynastic conflicts and civil wars—a landed aristocracy emerged, displacing peasant freeholders. A common legal code was adopted in 1274–76, and the right of succession to the crown was fixed. Shortly before, Iceland (1261) and Greenland (1261–64) came under Norwegian rule, but the Hebrides (Western Isles), also Norwegian possessions, were lost in 1266. Before 1300, Hanseatic merchants of the Baltic towns secured control of the essential grain imports, weakening the Norwegian economy.
Norway lost its independence at the death of Haakon V in 1319, when Magnus VII became ruler of both Norway and Sweden. The Black Death ravaged the country in the middle of the 14th century. In 1397, the three Scandinavian countries were united under Queen Margrethe of Denmark. Sweden left the union in 1523, but for nearly 300 more years Norway was ruled by Danish governors. Although the loss to Sweden of the provinces of Bohuslän (1645), Härjedalen (1658), and Jämtland(1645) was a handicap, gradual exploitation of the forest wealth improved Norwegian status. Denmark's alliance with France during the Napoleonic Wars resulted in the dissolution of the union. With the Peace of Kiel (1814), Norway was ceded to Sweden, but the Faroe Islands, Iceland, and Greenland were retained by Denmark. However, Norwegians resisted Swedish domination, adopted a new constitution on 17 May 1814, and elected the Danish Prince Christian Frederick as king of Norway. Sweden then invaded Norway, but agreed to let Norway keep its constitution in return for accepting union with Sweden under the rule of the Swedish king. During the second half of the 19th century, the Storting (parliament) became more powerful; an upsurge of nationalist agitation, both within the Storting and among Norway's cultural leaders, paved the way for the referendum that in 1905 gave independence to Norway. Feelings ran high on both sides, but once the results were announced, Norway and Sweden settled down to friendly relations. The Danish Prince Carl was elected king of Norway, assuming the name Haakon VII.
Although Norway remained neutral during World War I, its merchant marine suffered losses. Norway proclaimed its neutrality during the early days of World War II, but Norwegian waters were strategically too important for Norway to remain outside the war. Germany invaded on 9 April 1940; the national resistance was led by King Haakon, who in June escaped together with the government, representing the legally elected Storting, to England, where he established Norway's government-in-exile. Governmental affairs in Oslo fell to Vidkun Quisling, a Fascist leader and former Norwegian defense minister who had aided the German invasion and whose name subsequently became a synonym for collaborator; after the German surrender, he was arrested, convicted of treason, and shot. During the late 1940s, Norway abandoned its former neutrality, accepted Marshall Plan aid from the United States, and joined NATO. King Haakon died in 1957 and was succeeded by Olav V. King Harold V succeeded his father who died 17 January 1991.
The direction of economic policy has been the major issue in Norwegian postwar history, especially as related to taxation and the degree of government intervention in private industry. Economic planning was introduced, and several state-owned enterprises have been established. Prior to the mid-1970s, Labor Party-dominated governments enjoyed a broad public consensus for their foreign and military policies. A crucial development occurred in November 1972, when the Norwegian electorate voted in a referendum to reject Norway's entry into the EC despite a strong pro-EC posture adopted by the minority Labor government. After the 1973 general elections, the Labor Party's hold on government policies began to erode, and in the 1981 elections, the party lost control of the government to the Conservatives. Although the non-Socialists retained a small majority in the 1985 elections, disagreements among them permitted Labor to return to office in 1986.
Norway reconfirmed its rejection of the European Union on 28 November 1994, when the vote was cast 52% against, 47.8% for joining Europe. However, in December 2002, Prime Minister Kjell Magne Bondevik stated a new referendum would probably be held on EU membership. Public opinion polls in June 2003 registered 51.9% of the electorate in favor of joining the EU;38.2% were opposed and 9.9% were undecided. Norway was forthright in its support for the US-led war on terror following the 11 September 2001 attacks on the World Trade Center in New York and the Pentagon in Washington, D.C. It supported the NATO decision to invoke Article 5 of the alliance's constitution, pledging all members to collective security in the event of an attack on one. However, Norway did not support the US-led war in Iraq that began on 19 March 2003. Prime Minister Bondevik held that international weapons inspectors authorized by UN Security Council Resolution 1441 to inspect Iraq's weapons programs should be given more time to do their work, and that military action should not be taken without an express Security Council resolution authorizing it. Eight out of ten Norwegian voters agreed in March 2003 that Norway should not support the US and British decision to go to war against Iraq.