The town is known from 712, when it was mentioned in a document by the Lombard king Liutprand. From 1198 it was a possession of the Lupi family and was an imperial fief (a marquisate from 1347 and a principate from 1709), with the right to mint coins.
It is home to a medieval rocca (fortress), turned into a noble residence in the late 18th century. It has 16th century by Cesare Baglione and others. The park was turned into an English garden around 1820.