Iceland was first settled by Norwegians, in 874 A.D. During the late 9th and early 10th centuries, the island was settled by groups of Scottish and Irish immigrants. By the 10th century, the island's chiefdoms had become loosely united, and in 930 a parliament, the Althing, was established. (It is the oldest parliamentary body in the world.) About 986 some Icelanders settled in Greenland under the leadership of Eric the Red. Christianity became the official religion in 1000. A distinctive national culture developed in Iceland because of its distance from continental Europe. Iceland came under Norwegian rule in 1262 and under Danish rule in 1380. Its economy suffered because trade was monopolized by Danish merchants. Crop failures, epidemics, and volcanic eruptions during the 18th century severely reduced the island's population. In 1800 the Althing, which had long been powerless, was abolished by the Danish king. Within a few decades, however, a nationalist movement gained strength and in 1843 the Althing was reestablished. Jón Sigurdsson (1811–1879), who became Iceland's national hero, led the struggle for a constitution, which was granted in 1874. A degree of home rule was won in 1904. In 1918 Iceland was recognized as an independent state in a union under the Danish king, but Denmark still controlled foreign affairs. The occupation of Denmark by Germany in World War II disrupted the union. British forces occupied the island in 1940 to prevent a German invasion, as Iceland had no army or navy. During 1941–42 United States forces first supplemented, then replaced, the British. Iceland declared itself an independent republic in 1944 and was admitted to the United Nations in 1946. United States forces were withdrawn after World War II. Iceland joined the North Atlantic Treaty Organization (NATO) in 1949. Under the treaty, United States forces were sent in 1951 to be responsible for Icelandic defense. In 1958 the nation extended its fishing limits to 12 nautical miles offshore, and foreign fishermen were excluded from this zone. British opposition to this provoked a “cod war” between Iceland's coast guard and British trawlers; the dispute was ended by an agreement in 1961. In 1970 Iceland broadened its trading base by becoming a member of the European Free Trade Association. Extending its fishing limits to 50 nautical miles in 1972 caused another “cod war” with Britain, which was settled by compromise. In 1973 an eruption of Helgafell volcano led to the evacuation of the island of Heimaey. In 1975 a third “cod war” with Britain broke out when Iceland extended its fishing limits to 200 nautical miles. The dispute was settled, again by compromise, the following year, and Iceland's relations with Britain improved. In 1980 Vigdis Finnbogadottir was elected president—the first woman to be Iceland's head of state. Finnbogadottir served four terms and retired in 1995.