The castle was built in 1885 in the neo-Gothic style. Its construction was ordered by Pio Gravisi-Barbabianca, a doctor and nobleman from Koper. Later, the owners of the castle changed several times. For a while, it was even owned by the Municipality of Koper; currently, the castle has a private owner.

In the 1920s, the building used to house an Italian grammar school, and after the Second World War, it was even transformed into social housing units. After privatisation, the new owner renovated the building (some of its parts were demolished and had their original image restored, while the entrance gate, a part of the external defensive wall and frescoes have been retained) and added a chapel.