(renaming it Papia – the modern Pavia), and left early-medieval Milan to the governance of its archbishops. Middle Ages After the siege of the city by the Visigoths in 402, the imperial residence moved to Ravenna. An age of decline began which worsened when Attila, King of the Huns, sacked and devastated the city in 452 AD. In 539 the Ostrogoths conquered and destroyed Milan during the Gothic War against Byzantine Emperor Justinian I. In the summer of 569 the Lombards (from whom the name of the Italian region Lombardy derives), conquered Milan, overpowering the small Byzantine garrison left for its defence. Some Roman structures remained in use in Milan under Lombard rule. Milan surrendered to Charlemagne and the Franks in 774. The 11th century saw a reaction against the control of the Holy Roman Emperors. City-states emerged in northern Italy, an expression of the new political power of the cities and their will to fight against all feudal powers. Milan was no exception. It did not take long, however, for the Italian city-states to begin fighting each other to try to limit neighbouring powers. The Milanese destroyed Lodi and continuously warred with Pavia, Cremona and Como, who in turn asked Frederick I Barbarossa for help. In a sally they captured Empress Beatrice and forced her to ride a donkey backwards through the city until getting out. These brought the destruction of much of Milan in 1162. A fire destroyed the storehouses containing the entire food supply, and within just a few days Milan was forced to surrender. A period of peace followed and Milan prospered as a centre of trade due to its geographical position. During this time, the city was considered one of the largest European cities. In 1395, Gian Galeazzo Visconti became the first Duke of Milan after receiving the title from Wenceslaus, King of the Romans. In 1447 Filippo Maria Visconti, Duke of Milan, died without a male heir; following the end of the Visconti line, the Ambrosian Republic was established; it took its name from St. Ambrose, the popular patron saint of the city. Both the Guelph and the Ghibelline factions worked together to bring about the Ambrosian Republic in Milan. Nonetheless, the Republic collapsed when, in 1450, Milan was conquered by Francesco I of the House of Sforza, which made Milan one of the leading cities of the Italian Renaissance. Early modern Milan's last