The history of Gothenburg () begins with the foundation of the city in 1621, although by that time people had already been living in the area for thousands of years, since the Neolithic Period, and moreover there had already been a series of earlier settlements on the lower Göta Älv, including one which also bore the name Gothenburg. The Göta Älv has been of crucial importance throughout Swedish history as the country's only direct outlet to the North Sea, and thus to the wider world beyond the Baltic Sea. However, for many centuries the borders with Norwegian Bohuslän and Danish Halland ran right up to the river mouth, making Swedish settlements in the area extremely vulnerable to attack. The threat was significantly reduced by the conquests of both Bohuslän and Halland in the mid-seventeenth century, which gave Gothenburg the security to expand into Sweden's largest port and one of its main industrial centres. Prehistory The southwestern coast of the Scandinavian peninsula has been inhabited for several thousand years. During the Stone Age, there was a settlement at , close to the mouth of the Göta Älv, which gives its name to the wider that flourished in southwest Scandinavia during the period 8400-6000 BC. There are eleven rock carvings in the Gothenburg area. When the Kingdoms of Denmark, Norway and Sweden came into being in the late Viking Age, it appears that the entire western coastline of Scandinavia was claimed by Norway and Denmark, with the Göta Älv marking the frontier between the two kingdoms. However, during the High Middle Ages the Swedes seem to have conquered or otherwise taken control of a sliver of land on the south bank of the Göta Älv, as well as a foothold on the southern side of Hisingen island, and thereby secured access to the North Sea for the first time. It is not clear exactly when this territorial acquisition occurred, but it was probably in the mid-thirteenth century. Predecessors of Gothenburg Lödöse The earliest predecessor of present-day Gothenburg was the town of Lödöse, located 40 kilometres upstream from the present city, on the east bank of the Göta Älv. The town first emerged in the late Viking Age and became a flourishing trade centre during the Middle Ages. One of the earliest attestations of the name Lödöse is from the 1260 will of a certain Margareta Persdotter, in which the town is referred