Umbrians and Etruscans were most likely the first inhabitants of its location, though Castiglione was first recorded under the name Salebrone in Roman times, when the inland Prelius Lake - today mostly disappeared - provided fish and trading salt. In Medieval times, the town suffered from repeated pirate attacks, then in the 9th century it was under protection of the Republic of the Pisans, who used Castiglione as a key element in their system of defence along the Tyrrenian coast and built three towers - still exisitng today - joined by a wall that became the nucleus of the citadel.
In the 13th century, Castiglione became an independent comune. Meanwhile, the river Ombrone had started silting up Lake Prile, which soon became a lagoon, where malaria mosquitoes took hold, weakening the population of Castiglione. The town became part of the Grand Dukedom of Tuscany under the dynasty of Lorraine, who started a series of projects that drained the swamps, increasing the amount of arable land, as well as killing off the malaria carrying mosquitoes.