Castellana was born in the early Middle Ages thanks to the colonization carried out by the Monastery of San Benedetto di Conversano in the 10th century, precisely in 901. This is testified by a parchment which refers to the deed of sale of Ermenefrido, son of Ermuzio, and his wife Trasisperga in favor of Ianniperto.

The document speaks of a Castellano Vetere and a Castellano Novo. In 1098, Count Goffredo di Conversano, of Norman origins, gave San Benedetto the whole territory and allowed the abbot to gather people to populate it.

Its official foundation dates back to December 1171, when the Abbot Eustasio donated the fiefdom of Castellano with good conditions of vassalage to two Otrantini, Nicola and Costa, in an attempt to repopulate the agglomeration of existing houses, many of which were destroyed during the disputes between Roger II of Sicily and the Norman dynasty, to enjoy their income again.
The rebuilt vicus village soon became a universitas and, in this period, the presumed visit of Frederick II of Swabia and his one-night stay under the now non-existent Olmo di Porta Grande took place.

During the Swabian domination, the Conversano monastery of San Benedetto was abandoned, and in 1226 Pope Clement IV granted the Conversano convent to a group of Cistercian nuns who had fled from the Morea, a region of central Greece. They are assigned all the properties of the ancient abbey, including Castellana, and ecclesiastical jurisdiction: i.e. the ordinary power over the clergy and people of Castellana plus the right to challenge the pastoral staff and wear the miter.

After the death of Ladislao, in 1426, Queen Giovanna II of Naples appoints the Abruzzese nobleman Giacomo Caldora as duke of Bari, who obtained, among others, also the territory of Castellana. The Caldoras had power until 1440 when Antonio Caldora, Giacomo's eldest son and his successor to the title of duke of Bari, was overthrown by the vice-duke Marino Reguardati da Norcia, who offered the entire dukedom, together with Castellana, to Giovanni Antonio Orsini Del Balzo, prince of Taranto and son of Maria d'Enghien by her first husband.

Source : https://it.wikipedia.org/wiki/Castellana_Grotte