Historical sources trace the first origins of the castle to the IX century. Its existence there is testimony in a document dating back to the year 897. In the High Middle Ages the Lombards erected this fort whose original structure was based trapezoidal. In the course of the Middle Ages were added the cylindrical towers still exist and the bridge elevatoio, today disappeared. Between the XV and the XIX century the castle became the current configuration while preserving the typical Aragonese. Downstream of the Castle develops the historical center, from the characteristic narrow streets on which overlook artistic portals carved in local stone, the splendid valleys of the Osento and river Ofanto.
The castle was also an elegant residence of the family Orsini, Roberto il Guiscardo, Goffredo conte di Andria and in 1532 the Prince of Monaco honored Grimaldi; in 1642 it passed to Michele Sangermano and from 1689 until the abolition of the feudal rights in 1806, belonged to the lineage of Caracciolo. In 1049 became a bishopric and acquired importance as bishopric. Within the walls of the castle there is a chapel of which remains only a holy water stoup realized by Carpencivo for Order of Bishop Loseto in 1343.