 Mestwin II accepted them as his superiors in 1269, confirmed in 1273, but later on, in 1282, Mestwin II and Polish Duke Przemysł II signed the Treaty of Kępno, which transferred the suzerainty over Gdańsk Pomerania including Słupsk to Przemysł II.After Mestwin II's death the city was reintegrated with Poland and remained Polish until 1307, when the Margraviate of Brandenburg took over, while leaving local rule in the hands of the Swenzones dynasty, whose members were castellans in Słupsk.In 1337, the governors of Słupsk ("Stolp") had purchased the village of Stolpmünde (modern Ustka) and then constructed a port there, enabling a maritime economy to develop.