In 774 AD, Charlemagne
conquered northern Italy from the Lombards,
and soon after that Charlemagne got the Pope to name him the Holy Roman Emperor.
For the next three hundred years, northern Italy was in the hands
of the Holy Roman Emperor; that is, it belonged to the sons and grandsons
of Charlemagne, and then to the men who took over ruling the Holy
Roman Empire. Basically these men ruled Germany and Austria, and
they tended to live in Germany, so that northern Italy was being ruled
by far-away German kings who only came to Italy once in a while.

In 774 AD, central
and southern Italy still belonged to the old Roman
Empire. But the emperors in Constantinople were busy trying to
protect their kingdom from the Abbasids,
and had no time or soldiers to spare for Italy. So the Popes in Rome,
with the help of the kings of France,
became the main leaders of central and southern Italy.

More great articles:

By 830 AD, however, the Abbasids
had conquered Sicily and southern Italy, as part of their general
conquest of the Mediterranean Sea. So three different groups of people ruled Italy: the Islamic Empire ruled the
south, the Popes ruled the middle, and the Holy Roman Empire ruled the north.