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.
Prehistory and origin of Stockholm
The watercourse passing south of the old town of Stockholm first appears in historical records as the somewhat cryptic phrase: "What split off is called Stockholm" ("Stockholm heter det som sprack av"), found in a version of the "Saga of the Saint Olaf" by the Icelandic author Stymer Frode, preserved through a manuscript from the 14th century. Stymer explains, what today are the islands Södermalm and Stadsholmen was at the time united by an isthmus, and Saint Olaf of Norway (995-1030) produced the strait, in the saga called "Konungssund" ("King's strait"), by summoning assistance from superior forces. A slightly different version, undoubtedly the most famous, is the account of the Icelandic historian Snorri Sturluson (1178–1241). He retells, while King Olav of Norway raided the Lake Mälaren area, the Swedish king Olof Skötkonung (960s-1021/1022) hoped to trap him by pulling an iron chain over "Stocksund" ("Log Strait", e.g. modern Norrström passing north of the old town), a strait in addition guarded by a castellum and an army on either sides. The Norwegian king then dug himself through the southern isthmus and, helped by vivid streams produced by spring flood and favourable winds, managed to have his ships break through the foreshore and shoals, and finally escaped to the Baltic Sea. Snorri however adds, the Swedes refuted this version as drivel.