The castle originated in the XVI century, although the church inside dates back to the X century and was built on Iberian and Roman remains. For years it defended the area against the Moors and between the XVI and XVII centuries, against Barbary pirates.
In 1897, a banker called Manuel Girona bought and renovated it. It was later acquired by the Castelldefels Town Hall in 1988.
Guided tours to the castle often point out the graffiti of members of the International Brigades who were imprisoned there during the Spanish Civil War. They were not prisoners of the Nationalists but of the Republicans. Many were considered deserters or dissenters, and some were tortured and executed.