In 1088 it is mentioned as Castrum Pileum; according to a legend, the name would stem from the Latin pileum, the helmet of Roman general Quintus Fabius Maximus Verrucosus. In that period it depended from the bishop of Anagni and, from the late 12th century, it was first a fief of the De Pileo and then of the De Antiochia families. In 1347 it was captured by Cola di Rienzo and, from the late 14th century, it was under the Colonna family, who held it until 1816. In 1656 the town was decimated by plague.
Piglio became part of the newly formed Kingdom of Italy in 1870. During World War II, it was bombed by Allied planes, which destroyed about 30 percent of the edifices.