After the fall of the Western Roman Empire, Frosinone was destroyed several times by foreign invaders; in the early Middle Ages it was an agricultural center, usually of Papal allegiance. After escaping the dominance of the nearby commune of Anagni, in the early 14th century it fell under Alatri. In 1350, it was damaged by an earthquake. After the Sack of Rome (1527), Frosinone was also ravaged by German, Florentine and French troops and again, in 1556, by Spanish troops fighting against Pope Paul IV. The following year it became the official seat of the papal governor of the province of Campagna and Marittima.