 In 1161 it was a fief of the Counts of Cunio, but in 1202 it returned to the Papal States.It was later a possession of the da Polenta, Pepoli, Visconti and Este; the latter maintained it until 1597, when the city was again annexed to the Papal States.In 1424 the Castle of Zagonara (now destroyed) was the seat of the homonymous battle, in which a Milanese army defeated the Florentines.