The area of Castelliri has been inhabited since the Paleolithic era and was a Volscian settlement. Here the Samnites were active clashing in large battles with the Romans in the years before it became a Roman colony, that was probably managed by the members of the illustrious Gens Pompeiana.
The current town was formed in the Middle Ages when people sought refuge in castles on high ground under the protection of the abbeys and entrusted to the nobles. Castelliri has followed the fortunes of the Duchy of Sora being for a long time a fiefdom of the Cantelmos family. In 1460 the papal troops besieged Castelliri and it was put under direct administration of the Holy See, and subsequently passed to the families of Della Rovere and Boncompagni, and in 1580 the new Dukes of Sora.
In 1796 it became part of the Bourbon Kingdom and the following year was devastated by Napoleon’s troops. The tragic earthquake of 1915 and the bombing during the Second World War have left few surviving relics of its past.