According to a legend, the city was founded in ancient times by Idomeneus of Crete. Pliny the Elder attributes the foundation to the Senones Gauls, while more likely it was a Messapic settlement. Historically, what is known is that Gallipoli was a city of the Greater Greece, ruling over a large territory including today’s Porto Cesareo. In 265 BC it sided with Pyrrhus and Taranto against ancient Rome, suffering a defeat which relegated it as a Roman colony (later a municipium).
In the early Middle Ages, it was most likely sacked by the Vandals and the Goths. Rebuilt by the Byzantines, Gallipoli lived an economically and socially flourishing period due to its geographical position. Later it was owned by the Roman Popes, and was a centre of fighting against the Greek monastic orders.
In the 11th century Gallipoli was conquered by the Normans and, in 1268, it was besieged by Charles I of Anjou, causing numerous inhabitants to flee to the nearby Alezio. The city was repopulated around 1300, under the feudal rule of the principality of Taranto. In 1484 the Venetians tried to occupy it, but without results. King Ferdinand I of the Two Sicilies started the construction of the port, which in the 18th century became the largest olive oil market in the Mediterranean.
After the unification of Italy (1861), Gallipoli was capital of a circondario, together with Lecce and Taranto.