At Spoleto Faroald was deposed by his son Transemund II (724), who also rebelled against Liutprand and formed an alliance with Pope Gregory III, who sheltered him in Rome in 738. Ilderic, who had replaced him as duke, was slain by Transemund in 740, but in 742 Transemund was forcibly retired to a monastery by Liutprand, who conferred the duchy that he had rewon by force of arms upon Agiprand (742). By the time of Liutprand's death (744), Spoleto was more securely in central control from Pavia, and Theodicus succeeded peaceably. Three 8th-century dukes were Kings of the Lombards, a sign that in that period Spoleto was linked more closely to the kingdom than was Benevento. Imperial fief In 776, two years after the fall of Pavia, Spoleto fell likewise to Charlemagne and his Carolingian Empire, and he assumed the title King of the Lombards. Though he granted the territory to the Church, he retained the right to name its dukes, an important concession that can be compared to the as-yet uncontested Imperial right to invest territorial bishops, and perhaps at times a matter of contention between Emperor and Papacy, for Pope Adrian I had recently named a duke of Spoleto. In 842, the former duchy was resurrected by the Franks to be held as a Frankish border territory by a dependent margrave. Among the more outstanding of the Frankish dukes, Guido I divided the duchy between his two sons Lambert and Guido II, who received as his share the lordship of Camerino, which was made a duchy. Lambert was a doughty fighter against Saracen raiders, but who equally massacred Byzantines (as in 867), and was deposed in 871, restored in 876, and finally excommunicated by Pope John VIII. In 883 Guido II reunited the dukedom, henceforth as the Duchy of Spoleto and Camerino. After the death of Charles the Fat in 888, Guido had himself crowned Roman Emperor and King of Italy by Pope Stephen V (891). The following year Pope Formosus crowned Guido's son Lambert II as duke, king and emperor. The dukes of Spoleto continued to intervene in the violent politics of Rome. Alberico I, Duke of Camerino (897), and afterwards of Spoleto, married the notorious Roman noblewoman Marozia, mistress of Pope Sergius III (904–911), and was killed by the Romans in 924. His son Alberico II overthrew the senatrix in 932 though her son, his half-brother,