the port city with the medieval castle