The earliest mention of Stockholm in writing dates from 1252, when it was an important post in the iron trade from the mines in Bergslagen. The first part of the name — stock — means log, while the last part — holm — means islet or small island. The full origin of the name is disputed. The city is said to have been founded by Birger Jarl in order to protect Sweden from invasion from the sea by foreign navies and to stop pillage of the cities such as Sigtuna on Lake Mälaren. The first building at Stockholm was a fortification for the purpose of controlling the traffic between the Baltic Sea and Mälaren. Under the leadership of Magnus Ladulås Stockholm developed into an important trade city in the following decades, advanced through relations with Lübeck of the Hansa league. In 1270 Stockholm appears in historical documents as a city and in 1289 it was described as the most populated city in the Swedish region.