The castle again achieved notoriety during the Spanish Civil War when the International Brigades used it as a disciplinary prison camp, with resulting executions and torture.
The castle stands upon a 59-metre (194 ft) high hill to the northeast of the town centre, occupying a prominent position overlooking the coast.
It possesses a number of smaller towers of a variety of types, and the complex includes a church, and residential buildings on the western side.
The southern portion of the castle bailey is occupied by the partially fortified church and its associated outbuildings, including the rectory and vestry, and a cemetery.
[3] The entire complex of buildings, incorporating both the keep and the church and their associated outbuildings, is contained within a fortified enclosure, the wall of which has been modified throughout the castle's history.
A number of Iberian house remains were excavated under the church, although none have been found under the main area of the castle due to later modifications to the land surface, in order to level the courtyard in the middle of the 16th century.
The discovery of a 2nd-century funerary monument dedicated to Caius Trocina Synecdemus has led the excavator to attribute the ownership of the villa to him.
[4] The church of St. Mary was built on the hill in the 10th century by the monastery of Sant Cugat, which had been given instruction to develop the Castelldefels region by Sunyer, Count of Barcelona.
In response, King Philip II of Spain ordered the construction of an extensive series of fortifications along the Mediterranean coast.
On 26 August, a 25-year-old Aragonese baker by the name of Joaquín Figueras broke into the rectory and stabbed 60-year-old parish priest Jacint Orta Berenguer 14 times.
[8] Figueras was arrested in Barcelona on 3 September and confessed to the murders, although he denied robbing and raping Rita Bosch Orta.
[11] He contracted Catalan architect Enric Sagnier to restore the castle walls and towers, and add Gothic-style windows and doors.
[12] The castle was used as a base of operations by the Republican International Brigades from April 1938 to January 1939, being moved there from Albacete under pressure from an offensive by General Franco.
[14] It was then prepared as a prison camp by the Croatian commander Milan Ćopić, in order to hold brigade soldiers accused of indiscipline.
[15] During the 1989 restoration project, workers uncovered a Latin inscription upon a limestone block embedded in the rectory wall.
[17] The excavator believes that the memorial stone was found very close to its original location, and that the Roman villa belonged to Trocina Synecdemus.