Tallinn is the capital, primate and the most populous city of Estonia. Located in the northern part of the country, on the shore of the Gulf of Finland of the Baltic Sea, it has a population of 437,619 in 2020. Administratively a part of Harju County, Tallinn is the main financial, industrial and cultural centre of Estonia; the second largest city, Tartu, is located in the southern part of Estonia, 186 kilometres (116 mi) southeast of Tallinn. Tallinn is located 80 kilometres (50 mi) south of Helsinki, Finland, 320 kilometres (200 mi) west of Saint Petersburg, Russia, 300 kilometres (190 mi) north of Riga, Latvia, and 380 kilometres (240 mi) east of Stockholm, Sweden. It has close historical ties with these four cities. From the 13th century until the first half of the 20th century Tallinn was known in most of the world by its historical German name Reval. Tallinn, first mentioned in 1219, received city rights in 1248, but the earliest human settlements date back 5,000 years. The first recorded claim over the land was laid by Denmark in 1219, after a successful raid of Lyndanisse led by king Valdemar II, followed by a period of alternating Scandinavian and Teutonic rulers. Due to its strategic location, the city became a major trade hub, especially from the 14th to the 16th century, when it grew in importance as part of the Hanseatic League. Tallinn's Old Town is one of the best preserved medieval cities in Europe and is listed as a UNESCO World Heritage Site. Tallinn has the highest number of start-ups per person among European countries and is a birthplace of many international high technology companies, including Skype and Transferwise. The city is to house the headquarters of the European Union's IT agency. Providing to the global cybersecurity it is the home to the NATO Cyber Defence Centre of Excellence. Tallinn is ranked as a global city and has been listed among the top ten digital cities in the world. The city was a European Capital of Culture for 2011, along with Turku in Finland.