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.
Trams in Stockholm
However; In 1991 a long heritage line opened to the recreational area Djurgården; and in 2000, the non-radial half-circle line Tvärbanan opened with articulated low-floor vehicles connecting an inner ring of Metro and commuter rail stations just outside the inner city proper, with subsequent extensions in 2003 and 2014; and in 2010 the heritage line was extended and converted to a regular service line.
The first tramway in Stockholm was opened in 1877 and was drawn by horses. A tramline run on steam-power opened in 1887. Stockholm's tram network was converted to electrical propulsion 1901-1905. An extensive network formed in the early 20th century. Trams were effectively replaced by the Stockholm Metro from 1950 onwards, and all tram lines were closed down by 1967 due to the effect of Dagen H and replaced with buses (especially those in Stockholm proper), with the exception of two suburban tram lines, Lidingöbanan and Nockebybanan.