Early modern period
In the early modern period, the Holy Roman Empire was a union of territories in Central Europe under a Holy Roman Emperor the first of which was Otto I. The last was Francis II, who abdicated and dissolved the Empire in 1806 during the Napoleonic Wars. Despite its name, for much of its history the Empire did not include Rome within its borders.
Roman emperor
This line of Roman emperors was actually generally Germanic rather than Roman, but maintained their Roman-ness as a matter of principle. These emperors used a variety of titles (most frequently ""Imperator Augustus"") before finally settling on "Imperator Romanus Electus" ("Elected Roman Emperor"). Historians customarily assign them the title "Holy Roman Emperor", which has a basis in actual historical usage, and treat their "Holy Roman Empire" as a separate institution. To Latin Catholics of the time, the Pope was the temporal authority as well as spiritual authority, and as Bishop of Rome he was recognized as having the power to anoint or crown a new Roman emperor. The last man to be crowned by the pope (although in Bologna, not Rome) was Charles V. All his successors bore only a title of "Elected Roman Emperor".