The Holy Roman Empire (Latin: Sacrum Imperium Romanum; German: Heiliges Römisches Reich) was a large union of European territories that developed during the Early Middle Ages and continued until its dissolution in 1806.
The history of the Holy Roman Empire started with the coronation of the Frankish king Charlemagne as "Emperor of the Romans" in the year 800. His empire would later be divided between his descendants, with the western and eastern parts becoming France and Germany, respectively.
The Kingdom of Germany, also known as East Francia at the time, would become the core of the later Holy Roman Empire after Otto I, King of Germany, was crowned Emperor in 962.
In medieval times, the would-be Emperor was first elected "King of the Romans" by seven (four secular and three ecclesiastic) prince-electors, namely the King of Bohemia, the Count Palatine of the Rhine, the Duke of Saxony, the Margrave of Brandenburg and the Archbishops of Cologne, Mainz and Trier. Afterwards he would have to travel to Rome to be crowned Emperor by the Pope.
The Empire was very decentralised and was composed of hundreds of different kingdoms, principalities, duchies, counties, cities and ecclesiastical lands. While the rulers of these entities owed allegiance to the Emperor, his power was limited and the rulers were de-facto independent within their territories.
The Empire effectively came to an end when Emperor Francis II abdicated in 1806, after several German states formed the Confederation of the Rhine on Napoleon's behalf.