The Swabian castle of Trani is a castle built in the town of Trani in 1233 under the reign of Frederick II. In the castle often stayed the son of Federico Manfredi, on 2 June 1259 you married his second wife, Elena Ducas..
Construction began in 1233  and fortification works were completed in 1249, according to the draft Filippo Cinardo, Acquaviva count and Conversano, grand constable and the emperor's military engineer, and Stefano care of Romoaldo Carabarese with fortifications “davanti e intorno al castello”
The castle was built on a rocky bank located in the center of Trani's harbor, in a shallow area, which protected him from possible attacks from the sea. At the same site it had risen above a modest tower (X-XI century, whose remains were found in the entrance of the castle.
In this first phase was a quadrangular shape, with square towers at the corners and central courtyard. On three sides it was added to ground the outer wall, originally crossed by a walkway, which created three narrow forecourts. A moat, perhaps natural, separated the castle from the mainland.
In a castle tower Federico II hanged Pietro Tiepolo, son of the Doge of Venice Jacopo Tiepolo: Peter, mayor of Milan, was taken prisoner at the battle of Cortenova 1237.
In the castle often stayed the son of Federico Manfredi, on 2 June 1259 you married his second wife, Elena Ducas.
The castle was also imprisoned the brave Countess of Caserta Siffridina, consuocera of Frederick II, having his son Richard de Lauro Count of Caserta married the daughter Violante of Swabia. For his express wish he was kept on bread and water and died in March of 1279.
Under the Angevin, there were additions and changes made to the French military architect Pierre d'Angicourt. In 1268 it took place in the castle the wedding between Charles I of Anjou and Margaret of Burgundy, 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 it was in possession of the mercenary leader Alberico Barbian, who had been assigned by King Charles III of Naples.