Roman emperor
The Western Roman Empire collapsed in the late 5th century. Romulus Augustulus is often considered to be the last emperor of the West after his forced abdication in 476, although Julius Nepos maintained a claim recognized by the Eastern Empire to the title until his death in 480. Following Nepos' death, the Eastern Emperor Zeno abolished the division of the position and proclaimed himself as the sole Emperor of a reunited Roman Empire. The Eastern imperial lineage continued to rule from Constantinople ("New Rome"); they continued to style themselves as Emperor of the Romans (later βασιλεύς Ῥωμαίων in Greek), but are often referred to in modern scholarship as Byzantine emperors. Constantine XI Palaiologos was the last Roman emperor in Constantinople, dying in the Fall of Constantinople to the Ottomans in 1453.
Italy in the Middle Ages
Italy was invaded by the Visigoths in the 5th century, and Rome was sacked by Alaric in 410. The (traditional) last Western Roman Emperor, Romulus Augustus, was deposed in 476 by an Eastern Germanic general, Odoacer. He subsequently ruled in Italy for seventeen years as "rex gentium", theoretically under the suzerainty of the eastern Roman emperor Zeno, but practically in total independence. The administration remained essentially the same as that under the Western Roman Empire, and gave religious freedoms to the Christians. Odoacer fought against the Vandals, who had occupied Sicily, and other Germanic tribes that periodically invaded the peninsula.