A castle on the Wierzyca River was founded in the 14th century on the site of an old borough. It was meant for the use of the Teutonic Order.
The complex consisted of the main castle and an outer castle encircled by walls with four towers.
In 1454 the castle became the property of the townsmen of Gdańsk.
After the 13-year war it functioned as a seat of Polish governors.
Reconstruction works at the beginning of the 17th century changed its original Gothic appearance and gave it a Renaissance feature.