Prehistory and origin of Stockholm
According to the Chronicle of Eric, written in the 1320s, Stockholm was founded by Birger Jarl around 1250 as a lock to the Lake Mälaren region ("laas fore then sio", "lock before that lake") in order to prevent pirates from reaching the seven cities and nineteen parishes around it. Another medieval source ("Visbyannalerna"), however, claims the city was founded in 1187 following a pagan pillaged the city of Sigtuna, and as there was an "Earl" named Birger around at that time too, the disputed origin of the city are likely to remain obscure and some historians choose a diplomatic interpretation saying there was some sort of fortification around by the mouth of lake Mälaren when the city was founded during the second half of the 13th century. As Snorri mentions no city in his account but some sort of fortification called a "kastali" (in various manuscripts curiously said to be located east and west of "Stocksund"), it has generally been assumed this fortification eventually developed into the castle Tre Kronor located where still is the Stockholm Palace.
History of Stockholm
The name 'Stockholm' easily splits into two distinct parts – Stock-holm, "Log-islet", but as no serious explanation to the name has been produced, various myths and legends have attempted to fill in the gap. According to a 17th-century myth the population at the viking settlement Birka decided to found a new settlement, and to determine its location had a log bound with gold drifting in Lake Mälaren. It landed on present day Riddarholmen where today the Tower of Birger Jarl stands, a building, as a consequence, still often erroneously mentioned as the oldest building in Stockholm. The most established explanation for the name are logs driven into the strait passing north of today's old town which dendrochronological examinations in the late 1970s dated to around 1000. While no solid proofs exists, it is often assumed the Three Crown Castle, which preceded the present Stockholm Palace, originated from these wooden structures, and that the medieval city quickly expanded around it in the mid 13th century. In a wider historical context, Stockholm can be thought of as the capital of the Lake Mälaren Region, and as such can trace its origin back to at least two much older cities: Birka (c. 790–975) and Sigtuna, which still exists but dominated the region c. 1000–1240 — a capital which has simply been relocated at a number of occasions.