In the end of the XVI and in the XVII the castle was joined into the town's
fortification system. In the XVIII the mosat surrounding the castle was
filled up and the square near the castle was constructed.
In the XVII-XVIII several wings were added to the castle as it was used as a
public building by polish and Swedish officials. In the XVIII it became a
residence for Russian governor general. today a part of the building is
going to be rebuilt for presenta tions.