The construction of the castle was commissioned by Frederick II, Holy Roman Emperor following his decision to lead the Saracens rebels of Sicily in the town of Lucera, thus attempting to pacify the situation.
This addition was necessary for the difference in use that he wanted to make of the structure: from imperial palace as was intended to fortified castle and permanent military garrison.
The complex was heavily damaged by an earthquake that struck the area in 1456, and was almost completely demolished in the 18th century to use the resulting material for the construction of the court.
The courtyard at the third floor instead presented an octagonal shape, characteristics that resemble very closely the most famous structure built by Frederick II in the area: Castel del Monte.
It has been assumed that the entry was made possible by the presence of ladders downed from above, while the most evocative hypothesis (supported by the discovery of tunnels near the castle) suggests the access from an underground entrance.