 In 218 BC it regained its independence after the Roman defeat in the neighbourhood by Hannibal's army; however it fell again to Roman rule in 197 BC, when it was also set to fire.Never to recover its former splendour, it was annexed to the colonia of Piacenza, and remained under that city’s control after the fall of the Western Roman Empire.In the Middle Ages Casteggio came under the influence of Pavia, to which it was assigned by Frederick Barbarossa in 1164.