After the deposition of the last Western Emperor in 476, Heruli leader Odoacer was appointed Dux Italiae ("Duke of Italy") by the reigning Byzantine Emperor Zeno. Later, the Germanic foederati, the Scirians and the Heruli, as well as a large segment of the Italic Roman army, proclaimed Odoacer Rex Italiae ("King of Italy"). In 493, the Ostrogothic king Theoderic the Great killed Odoacer, and set up a new dynasty of kings of Italy. Ostrogothic rule ended when Italy was reconquered by the Byzantine Empire in 552.
In 568, the Lombards entered the peninsula and ventured to recreate a barbarian kingdom in opposition to the Empire, establishing their authority over much of Italy, except the Exarchate of Ravenna and the duchies of Rome, Venetia, Naples and the southernmost portions. In the 8th century, estrangement between the Italians and the Byzantines allowed the Lombards to capture the remaining Roman enclaves in northern Italy. However, in 774, they were defeated by the Franks under Charlemagne, who deposed their king and took up the title "king of the Lombards". After the death of Charles the Fat in 887, Italy fell into instability and a number of kings attempted to establish themselves as independent Italian monarchs. During this period, known as the Feudal Anarchy (888–962), the title Rex Italicorum ("King of the Italians" or "King of the Italics") was introduced. After the breakup of the Frankish empire, Otto I added Italy to the Holy Roman Empire and continued the use of the title Rex Italicorum. The last to use this title was Henry II (1004-1024). Subsequent emperors used the title "King of Italy" until Charles V. At first they were crowned in Pavia, later Milan, and Charles was crowned in Bologna.
In 1805, Napoleon I was crowned with the Iron Crown of Lombardy at the Milan Cathedral. The next year, Holy Roman Emperor Francis II abdicated his imperial title. From the deposition of Napoleon I (1814) until the Italian Unification (1861), there was no Italian monarch claiming the overarching title. The Risorgimento successfully established a dynasty, the House of Savoy, over the whole peninsula, uniting the kingdoms of Sardinia and the Two Sicilies to form the modern Kingdom of Italy. The monarchy was superseded by the Italian Republic, after a constitutional referendum was held on 2 June 1946, after World War II. The Italian monarchy formally ended on 12 June of that year, and Umberto II left the country.