Tallinn obtained city rights in 1248.

An excerpt from the article 27 facts about Tallinn

In 1236, the Danes took over the city again. They started building the largest fortifications in this part of their lands, with walls 2.5 km long (one of the longest in medieval Europe), 16 m high, and 45 towers.

In 1285, Rewel became a member of the Hanseatic League, and in 1346, Estonia and Rewel were purchased by the Teutonic Order. The Teutonic Knights rebuilt the 13th-century castle on the hill and added, among other things, a tower called "Long Herman".