In 1512 the town was occupied by troops led by Francesco Maria I della Rovere, Duke of Urbino, and a few years later it was conquered by the Republic of Florence, the latter, holding the town under its control for just few years. In the following years the Estensi returned to power; their domination lasting up to the invasion of the territory by the French army led by Napoleon Bonaparte.