The town rises on a hill at the outmost end of the Murge hills.
The name Messapica reminds of its foundation in very ancient times from a greek community probably coming from Creta, and the first part of the name from the ancient town of Caelia, which flourished on the site in the 4th century BC. Many important items were found in the nearby necropolis, among them a vase with red figures presently preserved in the Berlin museum, representing the Messapians fight against Diomedes.
Founded according to Greek historian Erodotusin the 13th century BC by Cretan king Japige directed to Sicily to avenge the death of Minos. But caught in a sea storm he landed in Salento, where he and his soldiers probably settled.
In the 7th century BC Ceglie was one of the 12 Messapian towns at war with Taranto. At that time the main center was an acropolis on top of the hill, which could be reached through stairs which still exist today. Under Roman times a slow decadence began, and in the Middle Ages Ceglie was a small village under the feudal rule of the baron of the castle built where the acropolis once rose.
A rebirth began also thanks to the monasteries founded by Greek monks, the Abbey of Sant'Anna and the monastery of Madonna della Grotta. The Sanseverino family were lords of the place for long centuries, followed by the Lubrano and Sisto y Britto.