IThe Swabian Castle of Trani was built in 1233, under the reign of Frederick II of Swabia. The construction was begun in 1233 and the fortification works were completed in 1249, according to the project of Filippo Cinardo, Count of Acquaviva and Conversano, the great conqueror and military engineer of the emperor, and by Stefano of Romoaldo Carabarese, with fortifications "in front And around the castle. " The castle had been built on a rocky bench located in the center of the Trani work, in a low-back area, protecting it from any assaults on the sea. At the same site a former small tower (X-XI century) was built, whose remains were found beneath the entrance of the present castle. In this first phase it was quadrangular, with square towers at the corners and central courtyard. Three outer sides were added to the outer wall, originally from an enclosure, which created three small outer courtyards. A moat, perhaps of natural origin, separated the castle from the mainland. At a castle tower Federico II hanged Peter Tiepolo, son of the doge of Venice Jacopo Tiepolo: Peter, the podestà of Milan, was captured in the battle of Cortenova in 1237. Frederick's son, Manfredi, often stayed in the castle, who on June 2, 1259 married his second wife, Elena Ducas. The brave Countess of Caserta Siffridina, Consuocera of Frederick II, was imprisoned in the castle, having his son Riccardo de Lauro Count of Caserta married the daughter of Emperor Violante of Swabia. By his express will he was kept in bread and water and died in March 1279. Under Angevin domination, it was added and modified by French military architect Pierre d'Angicourt. In 1268, the wedding of Charles I of Anjou and Margherita of Burgundy was held in 1268, and in 1271 those of the second son of Charles, Philip (1254-1277), with Isabelle de Villehardouin (1263-1312), princess of Achaia. Between 1385 and 1419 he was in possession of the Captain of Ventura Alberico da Barbiano, whom he had been assigned by the King of Naples Carlo III. Under Spanish rule, under Carlo V, in 1533, he underwent remarkable transformations to adapt to the new defensive needs arising from the invention of the shotgun. The intervention envisages the strengthening of the southern side, towards the mainland, and the construction of two bastions from two of the corner towers: north-east quadrangular and "spearhead" to the southwest. Between 1586 and 1677, it was the seat of the Royal Tribunal for the province of Bari ("Sacra regia udienza").