The complex combining a castle-town, city, and port began to take shape in the second half of the tenth century. Gdańsk then ruled by the dynasty of Pomeranian princes had a mixed population where the local Slavs lived side by side with growing numbers of merchants and craftsmen that arrived from the west. In the 12th century Gdańsk must have already grown to a large settlement for its times with several hundred homesteads, an open market, harbour, wharf, and defence bulwark.
Thanks to Prince Swietopelk II the Great, Gdańsk obtained city rights (of the Lübeck type). The ruler 's son and last prince of the Gdańsk Pomerania, Msciwoj II also called Mestwin, bestowed his land to Przemysl II, Prince of Great Poland in an act drawn in Kępno in 1282. That was a step of great political significance, as it enabled unification of the Polish territories. However, in view of the chaos that spread in Gdańsk following the death of the Czech king Vaclav (the ?więc family having sold Pomerania to the Margraves of Brandenburg), the governor of the castle, Bogusza, called on the Teutonic Knights for help. Those, having captured the castle in 1308 butchered the population. Since then the event is known as "the Gdańsk slaughter ".


