Italians wanted nothing to do with the Holy Roman Emperor (Romanorum Imperator) especially since his Empire had nothing to do with Rome itself. It was an assumed title, fictitiously resurrected from the infamous line of Romulus and Remus. and seated in Germany. The ancient title of Emperor had received a fatal blow when Odoacar deposed the child king Romulus Augustulus in 476 AD after only 10 months at the helm.
The Roman Empire ended and the Middle Ages began.
While the picture of succession is a bit hazy during those formative years, various German princes were elected King of the Germans which came with it, a sort of emperor-mystique. The battle between Church and State came to a violent head with the rise of Frederick I in 1155. The additional title, Holy, was added during his reign.
Frederick I or Barbarossa (Redbeard as he was nicknamed by his enemies in Italy) is considered by historians today to have been a marvel, a genius. For the people of Italy, he was nothing more than a foreign tyrant they constantly had to oppose both in the north and in the south. Frederick was determined to rule all of Italy and, on six occasions, sent expeditions into Italy to tame the land.
The Roman Catholic Church did all it could do to oppose him. The Church helped rally city-states to their defense but most of the city-states militias could not withstand the might of the Imperial army.
In 1167, Frederick met a new form of enemy, a federation of northern city-states; The Lombard League. Sixteen communities banded together to resist his advances in Italy.
In 1176, the Lombard League defeated him at Legano, forcing him to sign the Truce of Venice in 1177. While the city-states of northern Italy continued from there on to maintain their independence from one another, they also discovered that the presence of their confederacy, kept the Redbeard at bay.