Under the Lombards, Spoleto became the capital of an independent duchy, the Duchy of Spoleto (from 570), and its dukes ruled a considerable part of central Italy. In 774 it became part of Holy Roman Empire. Several of its dukes, mainly during the late 9th Century, rose to wear the crown of that Empire. Together with other fiefs, it was bequeathed to Pope Gregory VII by the powerful countess Matilda of Tuscany, but for some time struggled to maintain its independence. In 1155 it was destroyed by Frederick Barbarossa. In 1213 it was definitively occupied by Pope Gregory IX. During the absence of the papal court in Avignon, it was prey to the struggles between Guelphs and Ghibellines, until in 1354 Cardinal Albornoz brought it once more under the authority of the Papal States.