Present-day Tallinn lies where there was a commercial centre in the Middle Ages. In 1216, the Danes conquered the area and built a castle. The Danes called the castle Reval, but the Estonians called it Taani Linna (the Danish castle). A town grew up around the castle. As early as in the 1240 ´s , it was granted a town charter and in 1285 the town joined the Hanseatic League. Reval controlled great parts of the Russian and northern Baltic trade.
In 1346, the Danish King ,Valdemar Atterdag sold Estonia to the Teutonic Knights. The town was important to the Teutonic Knights - the order controlled the region from Tallinn. When the Knights were defeated in 1561, Tallinn surrendered to the Swedish King, Erik XIV. The town and its surroundings were a part of Sweden until the peace in Nystad in 1721.
In 1918 Estonia became independent with Tallinn as its capital. In 1940 the country was occupied by the Soviet Union. Since 1991, Tallinn is once again the capital of the independent republic of Estonia.
Tallinn has one of the best-preserved medieval town centres of the Baltic region, with town houses, churches, parts of the old castle and a town wall.